post_thumbnail_size хук-фильтр . WP 2.9.0
Filters the post thumbnail size.
Использование
add_filter( 'post_thumbnail_size', 'filter_function_name_5665', 10, 2 ); function filter_function_name_5665( $size, $post_id ){ // filter... return $size; }
- $size(строка/число[])
- Requested image size. Can be any registered image size name, or an array of width and height values in pixels (in that order).
- $post_id(число)
- The post ID.
Список изменений
С версии 2.9.0 | Введена. |
С версии 4.9.0 | Added the $post_id parameter. |
Где вызывается хук
wp-includes/post-thumbnail-template.php 157
$size = apply_filters( 'post_thumbnail_size', $size, $post->ID );