wp_kses_hook()
wp_kses_hook( string $string, array[]|string $allowed_h…
wp_kses_hook( string $string, array[]|string $allowed_html, string[] $allowed_protocols )
在这里添加任何KSES钩子。
You add any KSES hooks here.
在这里添加任何KSES钩子。
You add any KSES hooks here.
目录锚点:#说明#参数#源码
说明(Description)
目前只有一个KSES WordPress钩子,’preKSES’,它被称为这里。所有参数都被传递给钩子,并期望接收一个字符串。
参数(Parameters)
| 参数 | 类型 | 说明 |
|---|---|---|
| $string | (string) | 要通过kse筛选的内容。 |
| $allowed_html | (array[] | string) | 允许的HTML元素列表。 |
| $allowed_protocols | (string[]) | 允许的URL协议数组。 |
源码(Source)
/**
* You add any kses hooks here.
*
* There is currently only one kses WordPress hook and it is called here. All
* parameters are passed to the hooks and expected to receive a string.
*
* @since 1.0.0
*
* @param string $string Content to filter through kses
* @param array $allowed_html List of allowed HTML elements
* @param array $allowed_protocols Allowed protocol in links
* @return string Filtered content through 'pre_kses' hook
*/
function wp_kses_hook( $string, $allowed_html, $allowed_protocols ) {
/**
* Filter content to be run through kses.
*
* @since 2.3.0
*
* @param string $string Content to run through kses.
* @param array $allowed_html Allowed HTML elements.
* @param array $allowed_protocols Allowed protocol in links.
*/
return apply_filters( 'pre_kses', $string, $allowed_html, $allowed_protocols );
}| 更新版本 | 源码位置 | 使用 | 被使用 |
|---|---|---|---|
| 1.0.0 | wp-includes/kses.php | 16 | 12 |
类别:WordPress 函数手册、
本文收集自互联网,转载请注明来源。
如有侵权,请联系 wper_net@163.com 删除。


还没有任何评论,赶紧来占个楼吧!