Filter: um_late_escaping_allowed_tags

apply_filters( 'um_late_escaping_allowed_tags', $allowed_html, $context ) → {array}

Filters the allowed HTML tags and their attributes in the late escaping before echo.

Note: Please use the wp_kses() allowed tags structure.

Parameters:
Name Type Description
$allowed_html array

Allowed HTML tags with attributes.

$context string

Function context 'wp-admin' for Admin Dashboard echo, 'templates' for the frontend.

Since:
  • 2.5.4
Source:
Returns:

Allowed HTML tags with attributes.

Type
array
Example

It adds iframe HTML tag and 'onclick' attribute for strong tag.

function add_extra_kses_allowed_tags( $allowed_html, $context ) {
    if ( 'templates' === $context ) {
        $allowed_html['iframe'] = array(
            'src' => true,
        );
        $allowed_html['strong']['onclick'] = true;
    }
    return $allowed_html;
}
add_filter( 'um_late_escaping_allowed_tags', 'add_extra_kses_allowed_tags', 10, 2 );