Created
January 4, 2016 12:56
-
-
Save mrfoxtalbot/281f176c2f8d28daccbb to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add_filter( 'wpcf7_validate_email*', 'custom_email_confirmation_validation_filter', 20, 2 ); | |
function custom_email_confirmation_validation_filter( $result, $tag ) { | |
$tag = new WPCF7_Shortcode( $tag ); | |
if ( 'your-email-confirm' == $tag->name ) { | |
$your_email = isset( $_POST['your-email'] ) ? trim( $_POST['your-email'] ) : ''; | |
$your_email_confirm = isset( $_POST['your-email-confirm'] ) ? trim( $_POST['your-email-confirm'] ) : ''; | |
if ( $your_email != $your_email_confirm ) { | |
$result->invalidate( $tag, "Por favor comprueba que tu email coincide." ); | |
} | |
} | |
return $result; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment