Fixed issue

This commit is contained in:
Govind Kumar 2017-04-20 17:41:20 +05:30
parent 6b9bd2259f
commit 2adadd5737
1 changed files with 2 additions and 2 deletions

View File

@ -626,10 +626,10 @@ class WC_Checkout {
}
}
if ( in_array( 'email', $format ) && '' !== $data[ $key ] ) {
if ( in_array( 'email', $format ) ) {
$data[ $key ] = sanitize_email( $data[ $key ] );
if ( ! is_email( $data[ $key ] ) ) {
if ( '' !== $data[ $key ] && ! is_email( $data[ $key ] ) ) {
/* translators: %s: email address */
$errors->add( 'validation', sprintf( __( '%s is not a valid email address.', 'woocommerce' ), '<strong>' . $field_label . '</strong>' ) );
}