filter_block_content
filter_block_content ( $text, $allowed_html = 'post', $allowed_protocols = array() )
Parameters:- (string) text Text that may contain block content.
- (array[]|string) allowed_html Optional. 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. Default 'post'.
- (string[]) allowed_protocols Optional. Array of allowed URL protocols. Defaults to the result of wp_allowed_protocols().
Returns:- (string) The filtered and sanitized content result.
Defined at: - Introduced in WordPress: 5.3.1
- Deprecated in WordPress: —
Description
Filters and sanitizes block content to remove non-allowable HTML
from parsed block attribute values.