Menu Adam R Brown

WP hooks navigation: Home/browseActions indexFilters index

Source View: illegal_user_logins

To save our bandwidth, we show only a snippet of code around each occurence of the hook. View complete file in SVN (without highlighting).

Understanding Source Code

The best way to understand what a hook does is to look at where it occurs in the source code.

Remember, this hook may occur in more than one file. Moreover, the hook's context may change from version to version.

Source View

Line Code
475      if ( ! is_array( $illegal_names ) ) {
476           $illegal_names = array( 'www', 'web', 'root', 'admin', 'main', 'invite', 'administrator' );
477           add_site_option( 'illegal_names', $illegal_names );
478      }
479      if ( in_array( $user_name, $illegal_names, true ) ) {
480           $errors->add( 'user_name', __( 'Sorry, that username is not allowed.' ) );
481      }
482
483      /** This filter is documented in wp-includes/user.php */
484      $illegal_logins = (array) apply_filters( 'illegal_user_logins', array() );
485
486      if ( in_array( strtolower( $user_name ), array_map( 'strtolower', $illegal_logins ), true ) ) {
487           $errors->add( 'user_name', __( 'Sorry, that username is not allowed.' ) );
488      }
489
490      if ( ! is_email( $user_email ) ) {
491           $errors->add( 'user_email', __( 'Please enter a valid email address.' ) );
492      } elseif ( is_email_address_unsafe( $user_email ) ) {
493           $errors->add( 'user_email', __( 'You cannot use that email address to signup. There are problems with them blocking some emails from WordPress. Please use another email provider.' ) );