Warning: Trying to access array offset on false in /www/wwwroot/www.wpdongli.com/wp-content/themes/WPdongli/functions/wp.php on line 216
wp_kses_data() - 使用允许的HTML KSES规则清理内容 - WordPress函数 - WordPress动力
当前浏览:首页 / WordPress函数 / wp_kses_data()

wp_kses_data( string $data )

使用允许的HTML KSES规则清理内容


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 3 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

kses 清理

sanitize 清理more...


描述

此函数预设无反斜杠(unslashed)的数据。


参数

$data

(string)(必填) 要过滤的内容,预期不会转义。


返回

(string) 过滤后的内容。



源码

查看源码 官方文档


更新日志

版本描述
2.9.0开始引入

使用示例

  • 示例1

    实例

    下面的示例通过删除不允许的标记<div>和<script>。

    $s = '<div id="1st"><strong><i>Foo</i></strong><script>alert("Bar");</script></div>';
    $x = wp_kses_data($s);
    // Now, $x is <strong><i>Foo</i></strong>alert("Bar");