wp_pre_kses_block_attributes
函数
wp_pre_kses_block_attributes ( $string, $allowed_html, $allowed_protocols )
- 参数
-
-
(string)
$string
Content to be run through KSES.- Required: 是
-
(array[]|string)
$allowed_html
An array of allowed HTML elements and attributes, or a context name such as ‘post’.- Required: 是
-
(string[])
$allowed_protocols
Array of allowed URL protocols.- Required: 是
-
(string)
- 返回值
-
- (string) Filtered text to run through KSES.
- 定义位置
-
-
wp-includes/formatting.php
, line 5092
-
wp-includes/formatting.php
- 引入
- 5.3.1
- 弃用
- –
Removes non-allowable HTML from parsed block attribute values when filtering
in the post context.
function wp_pre_kses_block_attributes( $string, $allowed_html, $allowed_protocols ) { /* * `filter_block_content` is expected to call `wp_kses`. Temporarily remove * the filter to avoid recursion. */ remove_filter( 'pre_kses', 'wp_pre_kses_block_attributes', 10 ); $string = filter_block_content( $string, $allowed_html, $allowed_protocols ); add_filter( 'pre_kses', 'wp_pre_kses_block_attributes', 10, 3 ); return $string; }
声明:本站所有文章,如无特殊说明或标注,均为本站原创发布。任何个人或组织,在未征得本站同意时,禁止复制、盗用、采集、发布本站内容到任何网站、书籍等各类媒体平台。如若本站内容侵犯了原著者的合法权益,可联系我们进行处理。