Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function no_common_usernames($errors, $sanitized_user_login){
- $bad_usernames = array('admin', 'administrator');
- if(in_array($sanitized_user_login, $bad_usernames))
- $errors->add( 'bad_name', __('<strong>ERROR</strong>: This username is not allowed.') );
- if ( empty( $_POST['first_name'] ) )
- $errors->add( 'first_name_error', __('<strong>ERROR</strong>: You must include a first name.') );
- return $errors;
- }
- add_filter('registration_errors', 'no_common_usernames', 10, 2);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement