Notice: These forums are now retired and closed. For active support, please Submit a Ticket or visit our official WordPress.org community pages.
Kadence Theme | Kadence Blocks | Starter Templates | WooCommerce Email Designer | Ascend | Virtue | Pinnacle

double checking email address in contact form 7

Home / Forums / Virtue Theme / double checking email address in contact form 7

This topic is: Resolved
[Resolved]
Posted in: Virtue Theme
November 2, 2017 at 8:52 am

How do you make confirm email address to worK?
[your-email_confirm] does not seem to work.

The following is what I found online search, but the virtue functions.php is different.

function wpcf7_main_validation_filter( $result, $tag ) {
$type = $tag[‘type’];
$name = $tag[‘name’];
$_POST[$name] = trim( strtr( (string) $_POST[$name], “n”, ” ” ) );
if ( ’email’ == $type || ’email*’ == $type ) {
if (preg_match(‘/(.*)_confirm$/’, $name, $matches)){
$target_name = $matches[1];
if ($_POST[$name] != $_POST[$target_name]) {
if (method_exists($result, ‘invalidate’)) {
$result->invalidate( $tag,”address does not match”);
} else {
$result[‘valid’] = false;
$result[‘reason’][$name] = ‘address does not match’;
}
}
}
}
return $result;
}

add_filter( ‘wpcf7_validate_email’, ‘wpcf7_main_validation_filter’, 11, 2 );
add_filter( ‘wpcf7_validate_email*’, ‘wpcf7_main_validation_filter’, 11, 2 );

  • The forum ‘Virtue Theme’ is closed to new topics and replies.