begin_fetch_post_thumbnail_html

Fires before fetching the post thumbnail HTML.

Description

do_action( 'begin_fetch_post_thumbnail_html', (int) $post_id, (string) $post_thumbnail_id, (string|array) $size ); 

Provides just in time filtering of all filters in wp_get_attachment_image().

Parameters (3)

0. $post_id (int)
The post id.
1. $post_thumbnail_id (string)
The post thumbnail id.
2. $size (string|array)
The post thumbnail size. Image size or array of width and height values (in that order). Default post-thumbnail..

Usage

To run the hook, copy the example below.
  1. // run the action 
  2. do_action( 'begin_fetch_post_thumbnail_html', $post_id, $post_thumbnail_id, $size ); 
The following example is for adding a hook callback.
  1. // define the begin_fetch_post_thumbnail_html callback 
  2. function action_begin_fetch_post_thumbnail_html( $post_id, $post_thumbnail_id, $size ) { 
  3. // make action magic happen here... 
  4. }; 
  5.  
  6. // add the action 
  7. add_action( 'begin_fetch_post_thumbnail_html', 'action_begin_fetch_post_thumbnail_html', 10, 3 ); 
To remove a hook callback, use the example below.
  1. // remove the action 
  2. remove_action( 'begin_fetch_post_thumbnail_html', 'action_begin_fetch_post_thumbnail_html', 10, 3 ); 

Defined (1)

The action is defined in the following location(s).

/wp-includes/post-thumbnail-template.php  
  1. do_action( 'begin_fetch_post_thumbnail_html', $post->ID, $post_thumbnail_id, $size );