Skip to content

Commit

Permalink
Added support for additional HTML5 input types
Browse files Browse the repository at this point in the history
  • Loading branch information
alexminza committed Jan 25, 2018
1 parent 987616f commit 519bfad
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 4 deletions.
12 changes: 10 additions & 2 deletions includes/admin/class-wc-admin-settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -270,9 +270,17 @@ public static function output_fields( $options ) {

// Standard text inputs and subtypes like 'number'.
case 'text':
case 'email':
case 'number':
case 'password':
case 'datetime':
case 'datetime-local':
case 'date':
case 'month':
case 'time':
case 'week':
case 'number':
case 'email':
case 'url':
case 'tel':
$option_value = self::get_option( $value['id'], $value['default'] );

?><tr valign="top">
Expand Down
11 changes: 9 additions & 2 deletions includes/wc-template-functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -2140,11 +2140,18 @@ function woocommerce_form_field( $key, $args, $value = null ) {
. $args['label'] . $required . '</label>';

break;
case 'password':
case 'text':
case 'password':
case 'datetime':
case 'datetime-local':
case 'date':
case 'month':
case 'time':
case 'week':
case 'number':
case 'email':
case 'url':
case 'tel':
case 'number':
$field .= '<input type="' . esc_attr( $args['type'] ) . '" class="input-text ' . esc_attr( implode( ' ', $args['input_class'] ) ) . '" name="' . esc_attr( $key ) . '" id="' . esc_attr( $args['id'] ) . '" placeholder="' . esc_attr( $args['placeholder'] ) . '" value="' . esc_attr( $value ) . '" ' . implode( ' ', $custom_attributes ) . ' />';

break;
Expand Down

0 comments on commit 519bfad

Please sign in to comment.