wp_get_attachment_image_attributes

FILTER wp-includes\media.php (ligne 1181) github
Filters the list of attachment image attributes.

Paramètres

Entrée :
$attr, $attachment, $size
Sortie :
@param string[]     $attr       Array of attribute values for the image markup, keyed by attribute name.
@param WP_Post      $attachment Image attachment post.
@param string|int[] $size       Requested image size. Can be any registered image size name, or

Utilisation

// Modifier la valeur avec le filtre 'wp_get_attachment_image_attributes'
add_filter('wp_get_attachment_image_attributes', 'ma_fonction_filtre', 10, 1);

function ma_fonction_filtre($attr) {
    // Modifier la valeur
    return $attr;
}

Actualités

Chargement des actualités...