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:

Description

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

Related Functions

_filter_block_content_callback, filter_block_kses, register_block_core_post_content, register_block_core_list, register_block_core_pattern

Top Google Results

User discussions

wpseek mobile