I think the only solution you have at the moment is to disable all intermediate image sizes:
add_filter( 'intermediate_image_sizes', '__return_empty_array', 99 );
And then manually generate them, depending on the post type, by hooking into ‘wp_generate_attachment_metadata’, where you do have access to the attachment id (and therefore to it’s parent post):
function do_your_stuff( $data, $attachment_id ) {
// generate intermediate images
return $data;
}
add_filter( 'wp_generate_attachment_metadata', 'do_your_stuff', 10, 2 );
Related Posts:
- add_image_size() for specific Post Types
- set_post_thumbnail_size in percent, not pixels?
- Removing Image Sizes for Custom Post Type
- Image size filtering in Media uploader according to custom post type
- add_image_size for post type
- How to rename image at uploading on specific plugin or post-type in WordPress
- Change post featured image on hover
- Custom Image Thumbnails of Different Sizes
- Force documents to appear in Featured Image dialogue
- Get image post ID in media upload
- Link to full size post thumbnail
- Multiple featured sizes / images / excerpts
- How can i add thumbnails images to particular post (using code not admin pannel) in wordpress
- 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]
- Is it possible to add posts and images (auto resize) for custom post types with a script?
- Using Image Sizes for Custom Post Types outside the Loop
- link featured image to external link
- Cannot upload featured image to a custom post type
- Thumbnails Not Generating
- Multi Photo Upload with Caption on Front End for Custom Post Type
- Allow authors to create article image
- Front end post or photo or both
- 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 come Featured Image isn’t showing up in my Custom Post Type?
- How can I bulk upload images and automatically create posts for each one at the same time?
- Use a separate upload folder for custom post attachment upload
- Handling front-end file uploads, considering safety and ease of use
- Using add_theme_support inside a plugin
- Why does my custom WP role need edit_posts to edit images?
- Make featured image required
- How to add a CSS class to every image in a Custom Post Type
- Creating a metabox to upload multiple images, Ignoring The Featured Image
- Best way to filter featured image text for a custom post type?
- Set custom upload path for custom post type only?
- Add metabox with media uploader in a custom post type [duplicate]
- How I upload, save and set a featured image from my frontend?
- How to upload imagick resource to media in wordpress
- Trouble adding custom featured image for custom taxonomy TERMS
- Uploaded image not appearing in custom post type
- How to remove thumbnail sizes for specific post type on a child theme?
- image srcset returns false
- Change upload_dir folder at a certain cpt but cant change back
- How to use different featured image size for a custom post type?
- get_the_post_thumbnail() returning empty string on custom post type
- How to add multiple featured image in meta box in post editor?
- How to List Thumbnails based on Custom Categories
- Thumbnails produce unwanted gray pixels on white background [closed]
- get custom post type thumbnail
- window.send_to_editor and jQuery .attr() conflicts with multiple custom upload image meta boxes
- add_image_size() and uploading the exact size leaves 1×1 image in uploads
- List all images from a single post meta value
- Featured Images does not show in custom post type
- Loading custom post thumbnail into stream
- How to move image thumbnails into custom folder for custom post type
- How to set YouTube video as featured image?
- WordPress 3.5 Media Uploader – Only allow 1 upload and certain file types
- Hide editor while keeping add media button in custom post type
- How to automatically set ‘default image size’ for specific Custom Post Type
- Custom Post Type Video – Online/Offline
- How to update post meta on uploaded image from a custom form?
- Can’t generate thumbnail images
- 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 do you create a custom template to display a category with an image and related posts below?
- How to: wordpress job listing and candidates details
- How to handle large number of images in a post?
- How do you get the full size url of an attachment image
- get_the_post_thumbnail_url(‘full’) returns empty from custom post type
- Unable to set featured image
- Why won’t this jQuery code work?
- How can i link a custom post type thumbnail to intermediate size
- False Positive on has_post_thumbnail
- Custom post doesn’t show featured image
- How do you output an unknown number of images in a custom post type with desired markup?
- Auto post creation
- Dynamically determine the width and height of a image file to be cropped & uploaded AFTER form submission given fixed aspect ratio
- Invalid file type when using wp_upload_bits to upload PDF to a custom post type
- How to add Support to show Fullwidth Featured Image of Custom Post Types in WordPress.?
- i need to have a tab with gategory post
- How to add a default predefined thumbnail when creating a brand new post?
- Why this didn’t work if i use get_the_ID(), but works if i pass the numeric id
- How can I add image sizes for a specific custom post type?
- Change picture attachment meta of all occurrences of a picture
- Make it impossible to save a custom post type with both video and image selected?
- Links Image in “Catalog” Page to Posts
- retrieve custom post image through widget
- Custom Upload Directory for Custom Post Types
- How do I set a specific size for my image?
- Working with gallery shortcode and get gallery images
- Image paths on custom post types getting /post_type/ added to path
- Thumbnails for custom post not showing up in query
- How to scroll through post thumbnails?
- Customized featured image doesn’t refresh in post admin metabox after upload/insert
- Custom Post Type to Upload Images
- Specific Thumbnail Size for Custom Content Type
- Delete old thumbnail when updating new