来源: 互联网 日期: 2020-07-16 17:08:46
在wordpress主题的functions.php文件中加入一段代码即可让wordpress支持中文用户名。
代码如下:
function zyku_non_strict_login( $username, $raw_username, $strict ) {
if( !$strict )
return $username;
return sanitize_user(stripslashes($raw_username), false);
}
add_filter('sanitize_user', 'zyku_non_strict_login', 10, 3); (抓润网帝国模板 www.zhuarun.com)