admin_post_thumbnail_size
takes three parameters:
-
$thumb_size: selected Thumb Size if you do nothing in the filter.
-
$thumbnail_id: Thumbnail attachment ID.
-
$post: associated WP_Post instance
So you may make use of these parameters to have a better control in your CODE. Use the CODE like below:
function custom_admin_thumb_size( $thumb_size, $thumbnail_id, $post ) {
if( 'slider' === $post->post_type ) {
return array( 1000, 400 );
}
return $thumb_size;
}
add_filter( 'admin_post_thumbnail_size', 'custom_admin_thumb_size', 10, 3);
Related Posts:
- How come Featured Image isn’t showing up in my Custom Post Type?
- Load a script just to custom post type in admin
- Placing a Custom Post Type Menu Above the Posts Menu Using menu_position?
- add_image_size() for specific Post Types
- Loading External Scripts in Admin but ONLY for a Specific Post Type?
- Customize Edit Post screen for Custom Post Types?
- Filter by custom field in custom post type on admin page
- How to disable generation of default image sizes for some custom post types?
- Showing User’s Post Counts by Custom Post Type in the Admin’s User List?
- Merge two custom post types into one admin page?
- Remove the “View” Link in Post Admin
- Multiple custom post types under one admin menu
- How can I change the admin search posts fields?
- Using add_theme_support inside a plugin
- Custom post type: Add “Edit | Quick Edit | Trash | View” links to date (if title is not shown in column)?
- Custom user role cannot see or modify featured image
- Make featured image required
- How to remove “featured image” functionality from a custom post type?
- Admin Area Custom Type Search By Meta Fields Without Title & Content
- Add “Last Edited by” column to custom post type list table
- Featured Image Panel Missing From Custom Post Type in WordPress 3.2
- How can I filter posts by post_parent in the admin?
- Filter custom post types in admin not working
- Custom post type admin search
- Ordering posts by custom taxonomy in admin area
- Create a dropdown with Custom Post Types as option in admin
- set_post_thumbnail_size in percent, not pixels?
- How to add custom columns to Custom Post Type admin screen
- How to Make an admin_notices Message That Disappears Once the User Leaves That Particular Page?
- Filter admin columns by custom post field value
- Is it OK to move admin menu items?
- Best way to filter featured image text for a custom post type?
- Prevent reload confirmation after AJAX save
- Filter by custom Field for Custom post type Admin Listing
- jQuery UI in Admin (Best Practice?)
- Admin Post Update Redirection to Posts Screen
- Exclude add_filter from the admin
- If featured image doesn’t exist, show post content
- Renaming Menu Item within Admin Menu Section for a Custom Post Type?
- Custom Post type sort order not working in the admin area
- Custom admin columns for ALL custom post types
- How to get search results in the backend admin on a custom post type?
- set and unset the custom field value
- How I upload, save and set a featured image from my frontend?
- Add custom column to custom post type overview in backend
- Unable to filter on field on edit.php page
- Trouble adding custom featured image for custom taxonomy TERMS
- How to Change the Title of a Meta Box on a Specified Custom Post Type? [duplicate]
- How can i place Feature Image under title field in wp-admin?
- No results searching custom post type in admin panel
- How to remove thumbnail sizes for specific post type on a child theme?
- Featured image metabox not showing up
- image srcset returns false
- How to use different featured image size for a custom post type?
- How to add post_author column to custom post type
- Adding help information to custom post edit page
- Only Show an Author Their Custom Post Types
- Actions that Run on Admin Edit Page Load After Posts Are Queried
- Custom Post Type and taxonomies’s labels localization not working
- get_the_post_thumbnail() returning empty string on custom post type
- Filters post in admin with dropdown select, custom post type
- Admin List Dynamic Heading
- How can I add a column in the wp_list_table of the admin area?
- How to add multiple featured image in meta box in post editor?
- Show admin help message across custom post type parent and child posts
- How to show custom (checkbox) field value in admin post list?
- WordPress User Roles, Custom Post Types, and Admin views
- Settings page above CPT page in admin section
- Add featured image programatically to custom post type
- retrieve custom post image through widget
- Custom post type doesn’t display on admin list
- How To Loop Through list with Custom Post Types
- Customising the admin columns for a custom post type, but now most of the built in categories don’t display?
- Shared Custom post type between WP network sites
- Exclude categories For Custom post types
- Admin menu post type
- WordPress Author Posts Review After Every Change In The Same WordPress Post
- Redirect preview single post link to a page
- Custom Post Type Causing Admin Sidebar UI Issue
- How to change the default orderby from “Date” to e.g. “Title” or my custom column in content type records list in admin?
- Thumbnails for custom post not showing up in query
- Change column of row action (Quick Edit) links in WP_List_Table
- Collection of fields in a single post
- How to scroll through post thumbnails?
- Featured image in admin on custom post type
- Customized featured image doesn’t refresh in post admin metabox after upload/insert
- Prevent users from changing post status
- Specific Thumbnail Size for Custom Content Type
- Link to larger thumbnail in custom query (with custom post-types)
- Display read only info on admin, custom post page
- Custom Plugin w/ Custom Post Types – Custom Posts Are Showing at all Privilege Levels – Is this possible to adjust?
- Front end post or photo or both
- Delete old thumbnail when updating new
- How to set the Screen Options for Users in the Admin Panel?
- Issue displaying multiple TinyMCE editors with WPAlchemy
- Admin menu link with variable
- set_post_thumbnail or media_sideload_image adds image multiple times in media library
- How to Create Grey Background for Product Images on Website Display but Retain White Background on Downloaded JPGs?
- How to get Custom Post Type (CPT) Archive Page’s Posts Featured Images Preload in header.php
- How to set up a private custom post type that is accessible in the administrative dashboard?