WPDev.one
Core Function
View Source on Trac ↗

filter_block_kses()

filter_block_kses( mixed $block, mixed $allowed_html, mixed $allowed_protocols = array() )

Filters and sanitizes a parsed block to remove non-allowable HTML

Parameters 3 required

Name / Type Description
$block
WP_Block_Parser_Block

The parsed block object.

Required
mixed

(array[] | string) $allowed_html 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.

Required
string[]

$allowed_protocols Optional. Array of allowed URL protocols. Defaults to the result of wp_allowed_protocols().

Required

Return Value

(array)
The filtered and sanitized block object result.

Function Information

Since Version
5.3.1
Source File
wp-includes/blocks.php
Advertisement