use this code temporarily, put it in the file (functions.php) of your active theme.
in the next version of the plugin I will add this option, so do not forget to remove the code to the next version.
the code:
global $ben_____restricted_domain_emails;
$ben_____restricted_domain_emails = false;
add_filter( 'user_registration_email', function( $email ) {
global $ben_____restricted_domain_emails;
$BlackList = array('edu');
$scts = explode('.', $email);
$domains = $scts[count($scts)-1];
if ( !in_array( $domains, $BlackList ) && $email != '' && !email_exists( $email ) ) {
$ben_____restricted_domain_emails = true;
}
return $email;
});
add_filter( 'registration_errors', function( $errors, $login ) {
global $ben_____restricted_domain_emails;
if ( $ben_____restricted_domain_emails )
$errors->add( 'invalid_email', __( '<strong>ERROR</strong>: Sorry, this email address is not allowed.' ) );
return $errors;
}, 9, 2 );
you can add other domain, example:
$BlackList = array('edu','com','net');
The direct support of this plugin:
https://benaceur-php.com/?p=2268
-
This reply was modified 5 years, 4 months ago by Benaceur.
-
This reply was modified 5 years, 4 months ago by Benaceur.