Warning: Trying to access array offset on false in /www/wwwroot/www.wpdongli.com/wp-content/themes/WPdongli/functions/wp.php on line 216
sanitize_user - 过滤已清理的用户名字符串 - WordPress钩子 - WordPress动力
当前浏览:首页 / WordPress钩子 / sanitize_user

apply_filters( 'sanitize_user', string $username, string $raw_username, bool $strict )

过滤已清理的用户名字符串


Warning: Undefined array key -1 in /www/wwwroot/www.wpdongli.com/wp-content/themes/WPdongli/functions/reference-cat.php on line 185

Warning: Undefined array key 2 in /www/wwwroot/www.wpdongli.com/wp-content/themes/WPdongli/functions/reference-cat.php on line 186

Warning: Undefined variable $searchand in /www/wwwroot/www.wpdongli.com/wp-content/themes/WPdongli/functions/wp.php on line 154

Warning: Undefined array key "e283cc7ab1dbef6488b2693a393334ea" in /www/wwwroot/www.wpdongli.com/wp-content/themes/WPdongli/functions/wp.php on line 223

Warning: Undefined variable $searchand in /www/wwwroot/www.wpdongli.com/wp-content/themes/WPdongli/functions/wp.php on line 154

Warning: Undefined array key "80fa2dd3f78b55ea2349d22e0a81c475" in /www/wwwroot/www.wpdongli.com/wp-content/themes/WPdongli/functions/wp.php on line 223

Warning: Undefined variable $searchand in /www/wwwroot/www.wpdongli.com/wp-content/themes/WPdongli/functions/wp.php on line 154

Warning: Undefined array key "c1a818a38c2857eb318d2766bd35f8b7" in /www/wwwroot/www.wpdongli.com/wp-content/themes/WPdongli/functions/wp.php on line 223

kses 清理

sanitize 清理more...

usermore...


参数

$usernamestring
已清理的用户名。
$raw_usernamestring
清理前的用户名。
$strictbool
是否将清理限制为特定字符。


源码

查看源码 官方文档


更新日志

版本描述
2.0.1开始引入

使用示例

  • 示例1

    从Codex迁移的示例:

    按sanitize_user()进行清理后,将用户名过滤为小写字母

    add_filter('sanitize_user', 'strtolower');