0

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 2

1

You can try WordPress Special Characters in Usernames plugin. This plugin enables usernames containing special characters (russian, cyrillic, arabic) on your WordPress blog.

2
  • not work well, i want coding not plugin Dec 2, 2017 at 14:02
  • 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.
    – Rup
    Mar 16 at 11:22
1

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.