May be this filter should work intermediate_image_sizes
Note: This solution will work if you are uploading an image from post edit screen. (tested on localhost with WP-3.8.1)
add_filter( 'intermediate_image_sizes', 'ravs_slider_image_sizes', 999 );
function ravs_slider_image_sizes( $image_sizes ){
// size for slider
$slider_image_sizes = array( 'your_image_size_1', 'your_image_size_2' );
// for ex: $slider_image_sizes = array( 'thumbnail', 'medium' );
// instead of unset sizes, return your custom size for slider image
if( isset($_REQUEST['post_id']) && 'your_custom_post_type' === get_post_type( $_REQUEST['post_id'] ) )
return $slider_image_sizes;
return $image_sizes;
}
Related Posts:
- Creating an Image-Centric Custom Post Type?
- How to disable generation of default image sizes for some custom post types?
- Image size filtering in Media uploader according to custom post type
- How to rename image at uploading on specific plugin or post-type in WordPress
- Get image post ID in media upload
- How to Create an Image Upload Box for Custom Posts?
- frontend image post uploader
- Redirect to another page using contact form 7? [closed]
- How to add multiple images to a custom post type without plugin [closed]
- Multi Photo Upload with Caption on Front End for Custom Post Type
- Allow authors to create article image
- Add Image field to CPT
- How can I create a custom meta box to add an mp4 video to a page?
- window.send_to_editor and jQuery .attr() conflicts with multiple custom upload image meta boxes
- Delete link on single-custom.php with redirection
- How to structure a site with product variations pages?
- CPT: if more than X images are in post, use pagination
- List all images from a single post meta value
- Remove fields on media uploader for custom page type – not working for “From Computer” or “From Url” tabs?
- Custom Image Thumbnails of Different Sizes
- Is there a way to have the view link on manage posts page to open in a new window or tab?
- Getting rid of /my_custom_post_type/ in the single view URL
- Custom post type menu missing after 3.0b2 -> 3.1.2 upgrade
- Custom Post Type – List all attachments on Edit Screen
- Duplicate Custom Header Functionality into the post edit screen
- Force documents to appear in Featured Image dialogue
- how to get URL of media uploaded to WordPress via media_handle_sideload()
- Group posts by custom post type
- Custom Page that comes with preloaded content for the user
- How inefficient is it to use a Custom Post for 4-5 sentences & pull all to 1 page?
- How to move image thumbnails into custom folder for custom post type
- How to check post type (to include custom css)
- How to customize a permalink (URL) structure?
- Plugin: register custom post types, child ready and performance best practices
- Display only one post each WEEK
- Display users uploaded files as posts
- uploading images to specified directories
- How to Mass Delete Images from Media Library
- WordPress 3.5 Media Uploader – Only allow 1 upload and certain file types
- Link to full size post thumbnail
- Permalink structure by Post Meta value
- Hide editor while keeping add media button in custom post type
- Add a button or image button that calls wp functions in the wp-admin
- Custom Post Type with image gallery
- Multiple featured sizes / images / excerpts
- How to integrate video slide using custom post types?
- How can i add thumbnails images to particular post (using code not admin pannel) in wordpress
- A question on creating filters for custom posts using taxonomy
- Conditional Query of Custom Post Type and custom taxonomy
- will post_id ever change? Can I safely use post_id for custom queries?
- List custom taxonomy specific to one custom post type
- Define new user capability for custom post types?
- How to allow visitors to enter custom post type?
- Create custom fields as image uploads [duplicate]
- Is it possible to create relational metabox values in a custom post?
- Custom Post Type Query for Sidebar Doesn’t Work on Front Page
- Meta query for custom post type ignored in main query
- 2 Templates 1 custom post type according url
- How do I move/order posts with a tag to the end?
- changing meta value and meta key of price field
- Add custom image size for custom post type or taxonomy
- WordPress sort search results by custom order
- Use same slug base for Custom Post Type posts, and multiple taxonomy terms
- How to get the upcoming post ID from front end?
- Hide parent categories when clicked, and show it’s childs
- Custom Path/Folder behind a custom post type
- How to automatically set ‘default image size’ for specific Custom Post Type
- Time based access control of custom post types – what is good approach?
- wp_generate_attachment_metadata is creating an empty array
- Show titles, date of all posts on single category page
- delete_published_posts does not work
- How to start a new post with custom Taxonomies already set?
- WooCommerce sort products by the actual product width(not the shipping width)
- Custom Post Type Video – Online/Offline
- Create a custom php page and load it at a specific slug
- Structure of data : CPT + terms
- How to handle paged param in post and custom-post-type?
- Default text in a specific post type, but not visible?
- Update postmeta Parent when post_status child change
- WP_Query custom post type query not showing the exact post type
- Shortcode to display Staff post type based on Location post type and Specialty post type
- Problem: wp_query outputs all images on site
- How to remove post listing page for a custom post type
- How to include term custom meta into the custom taxonomy term permalink structure
- How to Get WordPress custom post data in WooCommerce product meta panel? [closed]
- A form that can save/edit after first input
- Adding the_content() in custom template email
- Cannot save CPT meta box
- non-hierarchical post type with hierarchical url structure
- Send notification to the admin when new custom post is submitted
- How do i search authors from search form using author’s name
- Problems with image size on the server WordPress
- Allow users to create posts without logging in?
- How to update post meta on uploaded image from a custom form?
- How to add attributes to taxonomies that may be different from post to post?
- Pages are not saving due to custom post type
- Migrating a taxonomy’s tags to the native category
- Adding custom image sizes and post types to a plugin or to a theme?
- Checking if $_FILE isset for an array of file upload metaboxes
- How to produce a sub-page-system in WordPress