From 608597bee9c39e1dfd98b5dc7f31ff00a7ba334f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Reu=CC=88el=20van=20der=20Steege?= Date: Wed, 7 Dec 2022 16:11:19 +0100 Subject: [PATCH] Remove unused method `Core\Util::input_fields_html()`. --- src/Core/Util.php | 63 ----------------------------------------------- 1 file changed, 63 deletions(-) diff --git a/src/Core/Util.php b/src/Core/Util.php index d64cf8d8..f0a2c86a 100644 --- a/src/Core/Util.php +++ b/src/Core/Util.php @@ -260,69 +260,6 @@ public static function get_remote_address() { return null; } - /** - * Convert input fields array to HTML. - * - * @param array $fields Array with fields data to convert to HTML. - * - * @return string - */ - public static function input_fields_html( array $fields ) { - $html = ''; - - foreach ( $fields as $field ) { - if ( ! isset( $field['type'], $field['name'] ) ) { - continue; - } - - $field = \wp_parse_args( - $field, - [ - 'id' => $field['name'], - 'type' => 'text', - 'value' => ( \filter_has_var( INPUT_POST, $field['name'] ) ? \filter_input( INPUT_POST, $field['name'], FILTER_SANITIZE_STRING ) : null ), - 'required' => false, - 'max' => null, - ] - ); - - // Field label. - $html .= sprintf( - ' ', - esc_attr( $field['id'] ), - $field['label'] - ); - - switch ( $field['type'] ) { - case 'select': - $html .= sprintf( - '', - esc_attr( $field['id'] ), - esc_attr( $field['name'] ), - ( $field['required'] ? 'required' : null ), - Pay_Util::select_options_grouped( $field['choices'] ) - ); - - break; - default: - $attributes = [ - 'type' => $field['type'], - 'id' => $field['id'], - 'name' => $field['name'], - 'value' => $field['value'], - 'max' => $field['max'], - 'required' => $field['required'], - ]; - - $html .= sprintf( '', Pay_Util::array_to_html_attributes( $attributes ) ); - - break; - } - } - - return $html; - } - /** * Method exists *