wp_lazy_loading_enabled

FUNCTION wp-includes\media.php (ligne 1832) github
Determines whether to add the `loading` attribute to the specified tag in the specified context.

Paramètres

Entrée :
$tag_name, $context
Sortie :
@param string $tag_name The tag name.
@param string $context  Additional context, like the current filter name
@return bool Whether to add the attribute.

Utilisation

// Utilisation de la fonction wp_lazy_loading_enabled
$result = wp_lazy_loading_enabled($tag_name, $context);

if ($result) {
    // Votre logique ici
}

Actualités

Chargement des actualités...