发布时间:2020-09-17
WordPress 常用函数 / sanitize_text_field,
清理用户输入或者从数据库中获取的字符串。
检查是否合法的 UTF-8 字符,将 < 转换成 HTML 实体,去掉所有标签,删除所有换行符,占位符,以及额外的空格,去掉八位字节。
<?php sanitize_text_field($string); ?>
$string
(string) (required) 将要清理的字符串。
Default: None
<script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script> <script> (adsbygoogle = window.adsbygoogle || []).push({}); </script>
(string)
清理之后的字符串
Since: 2.9.0
wp-includes/formatting.php.
全站搜索