WordPress at Your Fingertips
function is not described

filter_block_content() WP 5.3.1

Filters and sanitizes block content to remove non-allowable HTML from parsed block attribute values.

No Hooks.

Return

String. The filtered and sanitized content result.

Usage

filter_block_content( $text, $allowed_html, $allowed_protocols );
$text(string) (required)
Text that may contain block content.
$allowed_html(array[]|string)
An array of allowed HTML elements and attributes, or a context name such as 'post'.
Default: 'post'
$allowed_protocols(string[])
Array of allowed URL protocols.
Default: array()

Code of filter_block_content() WP 5.8.3

function filter_block_content( $text, $allowed_html = 'post', $allowed_protocols = array() ) {
	$result = '';

	$blocks = parse_blocks( $text );
	foreach ( $blocks as $block ) {
		$block   = filter_block_kses( $block, $allowed_html, $allowed_protocols );
		$result .= serialize_block( $block );
	}

	return $result;
}