post_thumbnail_html хук-фильтрWP 2.9.0

Filters the post thumbnail HTML.

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

add_filter( 'post_thumbnail_html', 'wp_kama_post_thumbnail_html_filter', 10, 5 );

/**
 * Function for `post_thumbnail_html` filter-hook.
 * 
 * @param string       $html              The post thumbnail HTML.
 * @param int          $post_id           The post ID.
 * @param int          $post_thumbnail_id The post thumbnail ID, or 0 if there isn't one.
 * @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).
 * @param string|array $attr              Query string or array of attributes.
 *
 * @return string
 */
function wp_kama_post_thumbnail_html_filter( $html, $post_id, $post_thumbnail_id, $size, $attr ){

	// filter...
	return $html;
}
$html(строка)
The post thumbnail HTML.
$post_id(int)
The post ID.
$post_thumbnail_id(int)
The post thumbnail ID, or 0 if there isn't one.
$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).
$attr(строка|массив)
Query string or array of attributes.

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

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

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

get_the_post_thumbnail()
post_thumbnail_html
wp-includes/post-thumbnail-template.php 219
return apply_filters( 'post_thumbnail_html', $html, $post->ID, $post_thumbnail_id, $size, $attr );

Где используется хук в WordPress

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