admin_post_thumbnail_size WordPress Filter Hook

The admin_post_thumbnail_size hook is a great way to set a custom post thumbnail size for your WordPress admin. This hook allows you to set the width and height of your post thumbnail in your WordPress admin.

apply_filters( 'admin_post_thumbnail_size', string|int[] $size, int $thumbnail_id, WP_Post $post ) #

Filters the size used to display the post thumbnail image in the ‘Featured image’ meta box.


Description

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.


Top ↑

Parameters

$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.


Top ↑

Source

File: wp-admin/includes/post.php

View on Trac



Top ↑

Changelog

Changelog
VersionDescription
4.4.0Introduced.

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.

Show More