wp_kses_split
函数
wp_kses_split ( $string, $allowed_html, $allowed_protocols )
- 参数
-
-
(string)
$string
Content to filter.- Required: 是
-
(array[]|string)
$allowed_html
An array of allowed HTML elements and attributes, or a context name such as ‘post’. See wp_kses_allowed_html() for the list of accepted context names.- Required: 是
-
(string[])
$allowed_protocols
Array of allowed URL protocols.- Required: 是
-
(string)
- 返回值
-
- (string) Content with fixed HTML tags
- 定义位置
-
-
wp-includes/kses.php
, line 976
-
wp-includes/kses.php
- 引入
- 1.0.0
- 弃用
- –
Searches for HTML tags, no matter how malformed.
It also matches stray `>` characters.
function wp_kses_split( $string, $allowed_html, $allowed_protocols ) { global $pass_allowed_html, $pass_allowed_protocols; $pass_allowed_html = $allowed_html; $pass_allowed_protocols = $allowed_protocols; return preg_replace_callback( '%(|$))|(]*(>|$)|>)%', '_wp_kses_split_callback', $string ); }
声明:本站所有文章,如无特殊说明或标注,均为本站原创发布。任何个人或组织,在未征得本站同意时,禁止复制、盗用、采集、发布本站内容到任何网站、书籍等各类媒体平台。如若本站内容侵犯了原著者的合法权益,可联系我们进行处理。