apply_filters( ‘wp_kses_allowed_html’, array[] $html, string $context )

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.

Parameters

$htmlarray[]
Allowed HTML tags.
$contextstring
Context name.

Source

return apply_filters( 'wp_kses_allowed_html', $html, $context );

Changelog

VersionDescription
3.5.0Introduced.

User Contributed Notes

  1. Skip to note 2 content

    If you need to allow ACF to use iFrames you can use this:

    add_filter( ‘wp_kses_allowed_html’, ‘acf_add_allowed_iframe_tag’, 10, 2 );
    function acf_add_allowed_iframe_tag( $tags, $context ) {
    if ( $context === ‘acf’ ) {
    $tags[‘iframe’] = array(
    ‘src’ => true,
    ‘height’ => true,
    ‘width’ => true,
    ‘frameborder’ => true,
    ‘allowfullscreen’ => true,
    );
    }
    return $tags;
    }

You must log in before being able to contribute a note or feedback.