WPDev.one
Core Function
View Source on Trac ↗

filter_block_kses_value()

filter_block_kses_value( mixed $value, mixed $allowed_html, mixed $allowed_protocols = array(), mixed $block_context = null )

Filters and sanitizes a parsed block attribute value to remove

Parameters 3 required

Name / Type Description
(string[]

| string) $value The attribute value to filter.

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
$block_context
array

Optional. The block the attribute belongs to, in parsed block array format.

Return Value

((string[])
| string) The filtered and sanitized result.

Function Information

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