I’m trying to setup a plugin filter to block specific email domains, I lifted this up from a forum topic way back. I can’t figure out how to set it up so this is going to be the default action for all forms. Will this block subdomains as well like @example.gmail.com? FYI I’m still using v1.10.
function block_free_email_addresses($valid, $value, $element)
{
$pattern = '/@(gmail|googlemail|hotmail|live|msn|outlook|yahoo|ymail|aol)\./i';
if (preg_match($pattern, $value)) {
$element->addError('Please provide your business email.');
$valid = false;
}
return $valid;
}
add_filter('iphorm_element_valid_iphorm_1_3', 'block_free_email_addresses', 10, 3);
Thank you for looking into this, really appreciate the help.
Darkspark
This topic was modified 9 months ago by darkspark.