你在这里添加任何kses钩子。
原型
wp_kses_hook( string $string, array $allowed_html, array $allowed_protocols )
描述
目前只有一个WordPress钩子,‘pre_kses’,它在这里被称为。所有参数都传递给钩子,并期望接收一个字符串。
参数
$string
(string)
(Required)
要通过kses过滤的内容
$allowed_html
(array)
(Required)
允许的HTML元素列表
$allowed_protocols
(array)
(Required)
链接中允许的协议
返回值
(string)
过滤内容
源文件
路径:wp-includes/kses.php
<?php
...
function wp_kses_hook( $string, $allowed_html, $allowed_protocols ) {
/**
* Filters 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 );
}
...
?>
其他
英文文档:https://developer.wordpress.org/reference/functions/wp_kses_hook/