begin_fetch_post_thumbnail_html
Fires before fetching the post thumbnail HTML.
Provides "just in time" filtering of all filters in wp_get_attachment_image().
Usage
add_action( 'begin_fetch_post_thumbnail_html', 'wp_kama_begin_fetch_post_thumbnail_html_action', 10, 3 ); /** * Function for `begin_fetch_post_thumbnail_html` action-hook. * * @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 an array of width and height values in pixels (in that order). * * @return void */ function wp_kama_begin_fetch_post_thumbnail_html_action( $post_id, $post_thumbnail_id, $size ){ // action... }
- $post_id(int)
- The post ID.
- $post_thumbnail_id(int)
- The post thumbnail ID.
- $size(string|int[])
- Requested image size. Can be any registered image size name, or an array of width and height values in pixels (in that order).
Changelog
Since 2.9.0 | Introduced. |
Where the hook is called
wp-includes/post-thumbnail-template.php 183
do_action( 'begin_fetch_post_thumbnail_html', $post->ID, $post_thumbnail_id, $size );
Where the hook is used in WordPress
wp-includes/default-filters.php 445
add_action( 'begin_fetch_post_thumbnail_html', '_wp_post_thumbnail_class_filter_add' );
wp-includes/default-filters.php 447
add_action( 'begin_fetch_post_thumbnail_html', '_wp_post_thumbnail_context_filter_add' );