I want to let users put there username in Arabic when they register a new account, I tried a lot of methods put problem still unsolved
2 Answers
You can try WordPress Special Characters in Usernames plugin. This plugin enables usernames containing special characters (russian, cyrillic, arabic) on your WordPress blog.
-
-
It's only a few hundred lines, and most of that is config. And it's already written and testsed. I'm sure you could skim it to understand how it works.– RupMar 16 at 11:22
By default WordPress limits non-Latin characters on usernames for security reasons but To allow users to use non-Latin letters in the username field, you can use the following code:
add_filter('sanitize_user', 'non_strict_login', 10, 3);
function non_strict_login( $username, $raw_username, $strict ) {
if( !$strict )
return $username;
return sanitize_user( stripslashes( $raw_username ), false );
}
Add the above code to the 'functions.php' file in your WordPress theme's directory.