There are comments in core code that this should be improved, but they are there for a while already. Basically there is no native function to add or remove part of some feature, only feature altogether.
Doing it manually would be running something like this after theme is done (late on after_setup_theme
hook):
function add_thumbnails_for_cpt() {
global $_wp_theme_features;
if( empty($_wp_theme_features['post-thumbnails']) )
$_wp_theme_features['post-thumbnails'] = array( array('your-cpt') );
elseif( true === $_wp_theme_features['post-thumbnails'])
return;
elseif( is_array($_wp_theme_features['post-thumbnails'][0]) )
$_wp_theme_features['post-thumbnails'][0][] = 'your-cpt';
}
Related Posts:
- How to add multiple featured image in meta box in post editor?
- How to List Thumbnails based on Custom Categories
- How to add a default predefined thumbnail when creating a brand new post?
- Where to put my code: plugin or functions.php?
- Should I use custom post types or a custom database tables for plugin development?
- Best way to flush_rewrite_rules for custom post type, in a mu-plugins plugin?
- Prevent trash/delete action on specific post types
- How to remove “featured image” functionality from a custom post type?
- How to add custom content template part for a custom post type on main query using a plugin
- Loading custom page template via plugin
- Why The Init Hook For Custom Post Types
- wordpress plugin error handling
- How to get term link that crosses different custom post types?
- register_taxonomy with multiple object type and update_count_callback
- How often do you need to register_post_type?
- Where to put archive-{post-type}.php
- How to use a dedicated template for the Custom Post Type from a plugin?
- Determine which template-{slug}.php is being loaded
- How to append text to title of Custom Post Type post (without affecting all titles on page)?
- Remove POST_TYPE from custom post type permalink
- Featured image metabox not showing up
- How to use different featured image size for a custom post type?
- Use a textarea for a custom post type
- Make custom post type display as a page
- reference the current category being used in the category.php page
- Gutenberg Featured-Image-panel missing when user with custom role edits Custom Post Type
- How to rename image at uploading on specific plugin or post-type in WordPress
- Custom Post Type Navigation on Custom Field
- Plugin translation not working apart from name and description
- Show Post Thumbnail In Custom Post From Other CPT
- Displaying media for custom post type
- Hook to override title, image and content
- Why is conditionally loading a custom plugin’s code only on a specific custom post type causing the site content to disappear?
- Custom posts don’t work
- No posts found – Custom Post Type show_ui
- How to customize a permalink (URL) structure?
- Multiple featured sizes / images / excerpts
- Update post meta not working in transition_post_status
- Addition of custom option panel crashes Media Library & Admin Area
- Custom post type archive page blank
- Custom post listing page layout of custom post type
- How to Get WordPress custom post data in WooCommerce product meta panel? [closed]
- A custom post type in another post type
- How do you create a custom template to display a category with an image and related posts below?
- Wrap meta boxes & data handling for specific post types in classes?
- how to post default thumbnail if post not created yet
- get_the_post_thumbnail_url(‘full’) returns empty from custom post type
- WordPress custom post type capabilities issue
- HowTo: Custom Post Type (Meta) to Custom Table
- Custom Empty Results page for my Custom Post Type
- False Positive on has_post_thumbnail
- detect your custom post type in WordPress
- Option page’s form doesn’t work
- How to group navigation items in the admin panel
- Custom post doesn’t show featured image
- How can I include active content in a custom post type?
- How to access the thank you page from the single post?
- Custom Meta Box returns no HTML
- Dynamic pages for linked categories and content
- shopping cart plugin development
- CPT to installable Plugin
- how can i show a google map in custom post type
- Cannot upload featured image to a custom post type
- filter the_content, custom post type, and wp_query
- Fill custom fields when saving custom post types
- How add column from new table in Custom Post Listing (admin)
- Change Dropdown jQuery to show/hide but with default place holder that shows all
- allowing custom user role to access custom post type in wordpress admin
- Is it possible to get the specific content on the search page?
- Get next and prev item from custom WP_Query and Custom Post Type
- How add Filter by Tags and by categories to custom post type in Gutenberg block
- Error 404 change permalink term custom term taxonomy
- Register custom_post_type from static function
- custom post type and user post count shortcode
- How to select meta key in custom database query
- Permalinks: custom post type -> custom taxonomy -> custom sub taxonomy -> post
- How to seperate posts by categories?
- Insert custom taxonomy into category query
- % encoded URL giving 404 error in WordPress
- Widget area for individual posts (custom post type)?
- How can I load Template file from wordpress plugin
- Custom post type that lets users create a set of posts?
- what file is required to be created in plugin folder in order to show all the post content of a CPT with the help of permalink
- Not Able to Get Custom Post Type in Single and Single-custom-post-type
- How to develop custom URL redirection
- Execute code only after user clicks ‘update’ button for CPT being edited
- Can the wp_posts table have the same slug (post_name) in multiple statuses (post_status)?
- Displaying multiple custom post types in single post type at admin section
- Custom Post Type Audio Content
- Organizing The Custom Post Type with Taxonomies / Parent Posts
- Not Able to Display Metabox Saved Checkbox and Selected option After Save/ Update
- Add category slug as class attribute in a link array
- Items By Group added to custom post type
- Custom post types working in functions.php but not in plugin
- Multiple Block Quotes without using HTML
- Set a Custom Post Type as a Homepage
- Need some hints for my own WP theme development
- Menu Structure and URL structure, with Pages and Post-Type-Posts
- Custom Post Type urls not working
- I want to show a list of post with title that have link goes to that post and icon under the specific category to which it belongs