删除当前元素所有不允许的属性。
它会调用wp_kses_hair()进一步将属性分开,然后使用 wp_kses_hair()的返回值构建新的 html 代码。
它会删除任何多余的 '<' 和 '>' 字符,另外还有一个功能就是他会检查标签是否有借宿的 xhtml 斜线,如果没有,它会添加上。
用法
参数
$element
(string) (required) html 元素/标签
default: none
$attr
(string) (required) html 标签的属性
default: none
$allowed_html
(array) (required) 允许的 html 元素
default: none
$allowed_protocols
(array) (required) 允许的协议
default: none
返回值
(string)
sanitized html element
修改记录
since: 1.0.0
源文件
wp-includes/kses.php