Filters and sanitizes block content to remove non-allowable HTML from parsed block attribute values.
Parameters
$textstring
Text that may contain block content.
$allowed_htmlarray[]|stringoptional
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'.Default: 'post'
$allowed_protocolsstring[]optional
Array of allowed URL protocols. Defaults to the result of wp_allowed_protocols().Default: array()
Return
string
The filtered and sanitized content result.
Uses · 4
str_contains()Polyfill for `str_contains()` function added in PHP 8.0.
Signature, return type and hooks compared across 5 parsed releases.
About this page
Parsed data
Generated from the wordpress-develop 7.0.4 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.