apply_filters( 'wp_kses_allowed_html', array[] $html, string $context )
- Since
- 3.5.0
Filters the HTML tags that are allowed for a given context.
Description
HTML tags and attribute names are case-insensitive in HTML but must be added to the KSES allow list in lowercase. An item added to the allow list in upper or mixed case will not recognized as permitted by KSES.
Compatibility
- WordPress
- since 3.5.0
- 6.7.7
- 6.8.8
- 6.9.7
- 7.0.4
- 7.1.0
Present in every tracked release (6.7.7 to 7.1.0).
Parameters
$htmlarray[]- Allowed HTML tags.
$contextstring- Context name.
Where this hook fires · 7
wp-includes/kses.php:1083wp_kses_allowed_html()wp-includes/kses.php:1089wp_kses_allowed_html()wp-includes/kses.php:1106wp_kses_allowed_html()wp-includes/kses.php:1118wp_kses_allowed_html()wp-includes/kses.php:1122wp_kses_allowed_html()wp-includes/kses.php:1126wp_kses_allowed_html()wp-includes/kses.php:1131wp_kses_allowed_html()
Source code
* * @since 3.5.0 * * @param array[] $html Allowed HTML tags. * @param string $context Context name. */ return apply_filters( 'wp_kses_allowed_html', $html, $context ); } switch ( $context ) { case 'post': /** This filter is documented in wp-includes/kses.php */ $tags = apply_filters( 'wp_kses_allowed_html', $allowedposttags, $context );Changelog
Introduced in 3.5.0. Unchanged from 6.7.7 through 7.1.0.
Signature, return type and hooks compared across 5 parsed releases.
About this page
- Parsed data
- Generated from the wordpress-develop 7.1.0 tag, 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.