Wordpress does not support Chinese character User name registration

Source: Internet
Author: User
Tags php code

A website that has been put on hold for a long time finally found a suitable template yesterday, which also means that the website may have to be started recently.

Then a small problem is that Chinese user names are not supported during user registration. The website is intended to interact with each other...

SO you have to find a solution to this problem ..

In fact, it is also very easy to search the Internet, the Chinese tutorials are almost the same to modify the WordPress source file formatting. php

How to change it? I also found the simplest piece of code.

Copy the following php code to functions. php in the current topic directory,

WordPress supports registering and logging on with a Chinese user name.

 

The code is as follows: Copy code
 
Function ludou_non_strict_login ($ username, $ raw_username, $ strict ){
If (! $ Strict)
Return $ username;
Return sanitize_user (stripslashes ($ raw_username), false );
}
Add_filter ('sanitize _ user', 'ludou _ non_strict_login ', 10, 3 );

The website you are interested in can see the circle cross love original from: http://www.qinghuo.net/web/wordpress/3056.html

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.