admin_post_thumbnail_size filter-hookWP 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.

Usage

add_filter( 'admin_post_thumbnail_size', 'wp_kama_admin_post_thumbnail_size_filter', 10, 3 );

/**
 * Function for `admin_post_thumbnail_size` filter-hook.
 * 
 * @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 int          $thumbnail_id Post thumbnail attachment ID.
 * @param WP_Post      $post         The post object associated with the thumbnail.
 *
 * @return string|int[]
 */
function wp_kama_admin_post_thumbnail_size_filter( $size, $thumbnail_id, $post ){

	// filter...
	return $size;
}
$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).
$thumbnail_id(int)
Post thumbnail attachment ID.
$post(WP_Post)
The post object associated with the thumbnail.

Changelog

Since 4.4.0 Introduced.

Where the hook is called

_wp_post_thumbnail_html()
admin_post_thumbnail_size
wp-admin/includes/post.php 1658
$size = apply_filters( 'admin_post_thumbnail_size', $size, $thumbnail_id, $post );

Where the hook is used in WordPress

Usage not found.