begin_fetch_post_thumbnail_html хук-событиеWP 2.9.0

Fires before fetching the post thumbnail HTML.

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

Использование

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(строка|int[])
Requested image size. Can be any registered image size name, or an array of width and height values in pixels (in that order).

Список изменений

С версии 2.9.0 Введена.

Где вызывается хук

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

Где используется хук в 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' );