Add Featured Image Support to All Post Types
Enables thumbnail (featured image) support on every registered public custom post type that does not already have it.
PHPby SnipCraft
php
<?php
add_action( 'init', 'scseed_thumbnails_all_cpts', 20 );
if ( ! function_exists( 'scseed_thumbnails_all_cpts' ) ) {
function scseed_thumbnails_all_cpts() {
$post_types = get_post_types( array( 'public' => true ), 'names' );
foreach ( $post_types as $post_type ) {
if ( ! post_type_supports( $post_type, 'thumbnail' ) ) {
add_post_type_support( $post_type, 'thumbnail' );
}
}
}
}#admin#cpt#featured-image#thumbnail