发布时间:2020-09-17
WordPress 常用函数 / sanitize_user,
清理用户名,去掉所有不安全的字符。
删除 HTML 标签,8进制,HTML实体,如果 $strict 参数设置为 true,将删除所有非 ASCII 字符,只保留数字,字母,_,空格,.,-,@。
<?php sanitize_user( $username, $strict ) ?>
$username
(string) (required) 要清理的用户名。
Default: None
<script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script> <script> (adsbygoogle = window.adsbygoogle || []).push({}); </script>
$strict
(boolean) (optional) 如果设置为 true,限制 $username 为数字,字母,_,空格,.,-,@。
Default: false
(string)
The sanitized username, after passing through filters.
Since: 2.0.0
wp-includes/formatting.php
全站搜索