diff --git a/includes/class-wc-countries.php b/includes/class-wc-countries.php index 2624d07247b..385655d3626 100644 --- a/includes/class-wc-countries.php +++ b/includes/class-wc-countries.php @@ -953,10 +953,11 @@ class WC_Countries { if ( $type == 'billing_' ) { $address_fields['billing_email'] = array( - 'label' => __( 'Email Address', 'woocommerce' ), - 'required' => true, - 'class' => array( 'form-row-first' ), - 'validate' => array( 'email' ), + 'label' => __( 'Email Address', 'woocommerce' ), + 'required' => true, + 'type' => 'email', + 'class' => array( 'form-row-first' ), + 'validate' => array( 'email' ), ); $address_fields['billing_phone'] = array( diff --git a/includes/wc-template-functions.php b/includes/wc-template-functions.php index 014f6c2b8ba..4a0861996df 100644 --- a/includes/wc-template-functions.php +++ b/includes/wc-template-functions.php @@ -1770,6 +1770,23 @@ if ( ! function_exists( 'woocommerce_form_field' ) ) { $field .= '

' . $after; + break; + case 'email' : + + $field = '

'; + + if ( $args['label'] ) { + $field .= ''; + } + + $field .= ''; + + if ( $args['description'] ) { + $field .= '' . esc_attr( $args['description'] ) . ''; + } + + $field .= '

' . $after; + break; case 'select' :