WordPress:Function Reference/wp kses

来自站长百科
跳转至: 导航、​ 搜索

描述[ ]

这个函数确定$string中只会出现允许的HTML元素名称,属性名称,属性参数值而且健全的HTML entities。你要将PHP引号中删除所有斜线,然后你才能够调用这个函数。

用法[ ]

%%% <?php wp_kses($string, $allowed_html, $allowed_protocols); ?> %%%

参数[ ]

$string
(string) filter through kses的内容
$allowed_html
(array) 允许的HTML元素的列表
$allowed_protocols
(array) (optional) Allow links in $string to these protocols.
默认允许的协议是http, https, ftp, mailto, news, irc, gopher, nntp, feed,和telnet。这包含了所有普通的链接协议,javascript除外,没有信任度的用户不能够使用javascript

返回[ ]

这个函数返回HTML的filtered string。

深入阅读[ ]

关于完整的函数的列表,请看看category Functions

同时,也看看Function_Reference