begin_fetch_post_thumbnail_html

ACTION wp-includes\post-thumbnail-template.php (ligne 200) github
Fires before fetching the post thumbnail HTML. Provides "just in time" filtering of all filters in wp_get_attachment_image().

Paramètres

Entrée :
$post->ID, $post_thumbnail_id, $size
Sortie :
@param int          $post_id           The post ID.
@param int          $post_thumbnail_id The post thumbnail ID.
@param string|int[] $size              Requested image size. Can be any registered image size name, or

Utilisation

// Ajouter une fonction au hook action 'begin_fetch_post_thumbnail_html'
add_action('begin_fetch_post_thumbnail_html', 'ma_fonction_personnalisee', 10, 1);

function ma_fonction_personnalisee($post->ID, $post_thumbnail_id, $size) {
    // Votre code ici
    error_log('Hook begin_fetch_post_thumbnail_html déclenché');
}

Actualités

Chargement des actualités...