Advertisement
Guest User

Untitled

a guest
Jul 14th, 2014
157
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.50 KB | None | 0 0
  1. function no_common_usernames($errors, $sanitized_user_login){
  2. $bad_usernames = array('admin', 'administrator');
  3. if(in_array($sanitized_user_login, $bad_usernames))
  4. $errors->add( 'bad_name', __('<strong>ERROR</strong>: This username is not allowed.') );
  5.  
  6. if ( empty( $_POST['first_name'] ) )
  7. $errors->add( 'first_name_error', __('<strong>ERROR</strong>: You must include a first name.') );
  8.  
  9. return $errors;
  10. }
  11. add_filter('registration_errors', 'no_common_usernames', 10, 2);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement