Advertisement
sbrajesh

UpperCase Username

Feb 9th, 2012
221
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.39 KB | None | 0 0
  1. add_filter('validate_username','custom_allow_uppercase_username',20,2);
  2.  
  3. function custom_allow_uppercase_username($is_valid,$user_name){
  4.     if($is_valid)
  5.         return $is_valid;//it is already valid, no need to waste the precious cpu cycles
  6.     $sanitized=sanitize_user($user_name,false);
  7.    
  8.    if(strtolower($sanitized)==strtolower($user_name))
  9.        return true;
  10.    return false;
  11. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement