Reference › Functions filter_block_kses ( WP_Block_Parser_Block $block , array[] | string $allowed_html , string[] $allowed_protocols = array() ): array
Since 5.3.1
Source wp-includes/blocks.php:2049Parameters Return Uses Used by Source History Filters and sanitizes a parsed block to remove non-allowable HTML from block attribute values.
Parameters
$blockWP_Block_Parser_Block The parsed block object.
$allowed_htmlarray[] | stringAn 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.
$allowed_protocolsstring[] optional Array of allowed URL protocols. Defaults to the result of wp_allowed_protocols().Default: array() Return
array The filtered and sanitized block object result. Uses · 2 filter_block_kses_value() Filters and sanitizes a parsed block attribute value to remove non-allowable HTML. filter_block_kses() Filters and sanitizes a parsed block to remove non-allowable HTML from block attribute values. Used by · 2 filter_block_content() Filters and sanitizes block content to remove non-allowable HTML from parsed block attribute values. filter_block_kses() Filters and sanitizes a parsed block to remove non-allowable HTML from block attribute values. Source View on Trac ↗ View on GitHub ↗
2049 function filter_block_kses ( $block , $allowed_html , $allowed_protocols = array ( ) ) { 2050 $block [ 'attrs' ] = filter_block_kses_value ( $block [ 'attrs' ] , $allowed_html , $allowed_protocols , $block ) ; 2051 2052 if ( is_array ( $block [ 'innerBlocks' ] ) ) { 2053 foreach ( $block [ 'innerBlocks' ] as $i => $inner_block ) { 2054 $block [ 'innerBlocks' ] [ $i ] = filter_block_kses ( $inner_block , $allowed_html , $allowed_protocols ) ; 2055 } 2056 } 2057 2058 return $block ; 2059 } History Introduced in 5.3.1 . Unchanged from 6.7.7 through 7.1.0.
6.7.7 6.8.8 6.9.7 7.0.4 7.1.0 Signature, return type and hooks compared across 5 parsed releases.
About this page Parsed data Generated from the wordpress-develop 6.9.7 tag, from src/wp-includes/blocks.php, and regenerated for each WordPress release so it tracks the code rather than a snapshot of it. Corrections Something wrong on this page? Report it and it gets fixed in the next regeneration.