wp_kses_allowed_html

FILTER wp-includes\kses.php (ligne 1045) github
Returns an array of allowed HTML tags and attributes for a given context.
traduction française
Renvoie un tableau des balises et attributs HTML autorisés pour un contexte donné.

Paramètres

Entrée :
$context = ''
Sortie :
@param string|array $context The context for which to retrieve tags. Allowed values are 'post',
@return array Array of allowed HTML tags and their allowed attributes.

Utilisation

Filtrer les tags HTML autorisés

Filtre pour modifier les tags.

security
add_filter('wp_kses_allowed_html', 'allow_custom_html');
function allow_custom_html($tags, $context) {
    if ('post' === $context) {
        $tags['custom'] = array('id' => true, 'class' => true);
    }
    return $tags;
}

Actualités

Chargement des actualités...