admin_post_thumbnail_size хук-фильтр . WP 4.4.0
Filters the size used to display the post thumbnail image in the 'Featured image' meta box.
Note: When a theme adds 'post-thumbnail' support, a special 'post-thumbnail' image size is registered, which differs from the 'thumbnail' image size managed via the Settings > Media screen.
Использование
add_filter( 'admin_post_thumbnail_size', 'filter_function_name_9607', 10, 3 ); function filter_function_name_9607( $size, $thumbnail_id, $post ){ // 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).
- $thumbnail_id(число)
- Post thumbnail attachment ID.
- $post(WP_Post)
- The post object associated with the thumbnail.
Список изменений
С версии 4.4.0 | Введена. |
Где вызывается хук
admin_post_thumbnail_size
wp-admin/includes/post.php 1551
$size = apply_filters( 'admin_post_thumbnail_size', $size, $thumbnail_id, $post );