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
<?php | |
/** | |
* Blocked Emails | |
*/ | |
add_filter( 'wpcf7_validate_email*', 'blocked_email_filter', 20, 2 ); | |
function blocked_email_filter( $result, $tag ) { | |
$blocked_emails = array('info@itbent.com','nancy@sixwebsoft.org'); //Blocked Emails | |
$email_name = array('your-email','email'); //Form Email Field Name | |
foreach ($email_name as $name) { |
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
<?php | |
/** | |
* Blocked Emails | |
*/ | |
add_filter( 'wpcf7_validate_email*', 'blocked_email_filter', 20, 2 ); | |
function blocked_email_filter( $result, $tag ) { | |
$blocked_emails = array('test@test.com','qwerty@test.com'); | |
$email_name = array('your-email','email','txtEmail'); | |
foreach ($email_name as $name) { |
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
<?php | |
add_filter( 'wpcf7_validate_email*', 'blocked_email_filter', 20, 2 ); | |
function blocked_email_filter( $result, $tag ) { | |
$blocked_emails = array('test@test.com','qwerty@test.com'); | |
if ( 'txtEmail' == $tag['name'] ) { | |
$your_email = isset( $_POST['txtEmail'] ) ? trim( $_POST['txtEmail'] ) : ''; | |
foreach ($blocked_emails as $blocked) { | |
if ( $_POST['txtEmail'] == $blocked ) { | |
$result->invalidate( $tag, "Email Blocked" ); |