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_filter_post_kses() - 使用允许的HTML标签清理文章内容 - WordPress函数 - WordPress动力
当前浏览:首页 / WordPress函数 / wp_filter_post_kses()

wp_filter_post_kses( string $data )

使用允许的HTML标签清理文章内容


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 4 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 "49998edb6dfae1db465e16830f15ce0c" 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 "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 "c662a3ca6b84e8f01cc3765430bbe052" 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

filter 过滤

kses 清理

postmore...

sanitize 清理more...


描述

文章内容是指“post”类型的页面内容,而不是表单中的$_POST数据。

此函数预设有反斜杠(slashed)的数据。


参数

$data

(string) (必填) 过滤文章内容,将使用反斜杠转义。


返回

(string) 使用允许的HTML标签和属性完整地过滤文章内容。



源码

查看源码 官方文档


更新日志

版本描述
2.0.0开始引入

使用示例

  • 示例1

    传递给kses()的第二个参数与其文档不匹配:

    wp_kses( string $string, array $allowed_html, array $allowed_protocols = array() )

    wp_kses