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:
- Load a script just to custom post type in admin
- Merge two custom post types into one admin page?
- Remove the “View” Link in Post Admin
- Using add_theme_support inside a plugin
- Make featured image required
- How to remove “featured image” functionality from a custom post type?
- Custom post type admin search
- Ordering posts by custom taxonomy in admin area
- 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?
- jQuery UI in Admin (Best Practice?)
- Exclude add_filter from the admin
- Custom admin columns for ALL custom post types
- How I upload, save and set a featured image from my frontend?
- Trouble adding custom featured image for custom taxonomy TERMS
- How to remove thumbnail sizes for specific post type on a child theme?
- Featured image metabox not showing up
- 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
- 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?
- Settings page above CPT page in admin section
- How to search CPT’s by meta query from the admin dashboard?
- Add theme options to custom post type admin pages [closed]
- Custom post admin filtering by post meta (the date)
- Admin Column Text Positioning
- reference the current category being used in the category.php page
- add_image_size for post type
- Gutenberg Featured-Image-panel missing when user with custom role edits Custom Post Type
- Changing ‘view’ link for custom post type on list post screen?
- Sort admin area by custom Event Date field
- Add html to cpt main page / admin edit.php
- Show Post Thumbnail In Custom Post From Other CPT
- Using global $post; to get featured image for custom post via WP_Query
- Displaying media for custom post type
- Is there a way to have the view link on manage posts page to open in a new window or tab?
- How to change post featured image using a custom field of category?
- How to only show posts assigned to current user, only in certain post types
- Change Featured Image / Thumbnail CMS Description
- Is it possible to show full content of the post when there is only one post in a grid?
- Adding HTML tags or css classes to admin columns
- How to set YouTube video as featured image?
- Create a page that will be used to create a custom post type
- Customize my custom taxonomy table in Admin panel
- Link to full size post thumbnail
- Multiple featured sizes / images / excerpts
- A simple script to allow sorting of custom posts in admin?
- Notify admin on new submit
- On update or create post redirect to current post position in list
- Options page – dropdown of users
- No Permission to add new Page, Post or CPT with Admin role
- Admin Column does not populate with data
- How do you create a custom template to display a category with an image and related posts below?
- how to post default thumbnail if post not created yet
- get_the_post_thumbnail_url(‘full’) returns empty from custom post type
- Post-thumbnail only for specific post-types?
- False Positive on has_post_thumbnail
- New “Custom Types” item in admin menu. Is this a plugin or a new wordpress feature?
- How to group navigation items in the admin panel
- 3 random images from custom post type, each in a div with a diffrent class
- Custom post doesn’t show featured image
- Plugin or method of allowing user to rearrange custom post types with drag and drop?
- sortable columns for multiple custom post types not working
- Dynamic pages for linked categories and content
- Add ‘page template’ column to dashboard for CPTs
- Filter posts of custom post type by meta key in (List All Section)
- get_post_types not working properly in admin
- Cannot upload featured image to a custom post type
- Require custom post type if is_admin() – template doesn’t show up?
- Add Permalink to Post Thumbnail, syntax code issues
- Multiple custom post types on same admin page
- using the loop in custom meta is messing up ‘add new’ post type
- Need help with simple “if statement” checks to output particlular CPT data depending on what client uploads/fills out
- Metaboxes inside Tab
- How can I put content before my custom post type default pages?
- i need to have a tab with gategory post
- How we can create menu from Appearance > Menu and use as a add-submenu-page for admin menu?
- Is there any filter to add a custom attribute to the tag in admin panel?
- Help Adding filter to Add Media button for custom post type
- Delete all custom posts then upload a new CSV of events
- Pagination in wp-admin for CPT
- Create an administation subpage containing posts in a certain category
- Customising the admin columns for a custom post type, but now most of the built in categories don’t display?
- Admin menu post type
- 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?
- Change column of row action (Quick Edit) links in WP_List_Table
- Prevent users from changing post status
- 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?
- 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?