$errors->
add( 'pass',
__( '<strong>Error:</strong> Passwords do not match. Please enter the same password in both password fields.'
), array
( 'form-field' => 'pass1'
) );
} if ( !
empty( $pass1 ) ) { $user->user_pass =
$pass1;
} if ( !
$update &&
isset( $_POST['user_login'
] ) && !
validate_username( $_POST['user_login'
] ) ) { $errors->
add( 'user_login',
__( '<strong>Error:</strong> This username is invalid because it uses illegal characters. Please enter a valid username.'
) );
} if ( !
$update &&
username_exists( $user->user_login
) ) { $errors->
add( 'user_login',
__( '<strong>Error:</strong> This username is already registered. Please choose another one.'
) );
} /** This filter is documented in wp-includes/user.php */
$illegal_logins =
(array) apply_filters( 'illegal_user_logins', array
() );
if ( in_array( strtolower( $user->user_login
),
array_map( 'strtolower',
$illegal_logins ), true
) ) { $errors->
add( 'invalid_username',
__( '<strong>Error:</strong> Sorry, that username is not allowed.'
) );
} // Checking email address.