Switch language

wpseek.com
A WordPress-centric search engine for devs and theme authors




is_email_address_unsafe [ WordPress Function ]

is_email_address_unsafe ( $user_email )
Parameters:
  • (string) $user_email The email provided by the user at registration.
Returns:
  • (bool) Returns true when the email address is banned.
Defined at:



Checks an email address against a list of banned domains.

This function checks against the Banned Email Domains list at wp-admin/network/settings.php. The check is only run on self-registrations; user creation at wp-admin/network/users.php bypasses this check.

Source


<?php
function is_email_address_unsafe$user_email ) {
    
$banned_names get_site_option'banned_email_domains' );
    if (
$banned_names && !is_array$banned_names ))
        
$banned_names explode"\n"$banned_names);

    if ( 
is_array$banned_names ) && empty( $banned_names ) == false ) {
        
$email_domain strtolowersubstr$user_emailstrpos$user_email'@' ) ) );
        foreach ( (array) 
$banned_names as $banned_domain ) {
            if ( 
$banned_domain == '' )
                continue;
            if (
                
strstr$email_domain$banned_domain ) ||
                (
                    
strstr$banned_domain'/' ) &&
                    
preg_match$banned_domain$email_domain )
                )
            )
            return 
true;
        }
    }
    return 
false;
}
?>

Examples [ wp-snippets.com ]

Top Google zoekresultaten

Meer ...

Gebruikersdiscussies [ wordpress.org ]

0 User Note(s)

Nog geen één. Wees de eerste!

Nieuw toevoegen ...



HTML5 Powered with CSS3 / Styling, Performance & Integration, and Semantics