I’m using following code to register post formats for my blog posts …
add_theme_support( 'post-formats', array( 'gallery', 'video', 'audio' ) );
Now, i want to add post formats support for my CPT ‘Portfolio’ too, but using different set of post formats. Using this code will add post format support for my CPT …
add_post_type_support( 'portfolio', 'post-formats' );
But i only want to register gallery and video post format for portfolio CPT. Using the code below does’nt work …
add_post_type_support( 'portfolio', 'post-formats', array( 'gallery', 'video' ) );
What code should i use?
I found an alternative approach.
There is a unique class in body tag for each post type. e.g for portfolio post type i can use the CSS code something like mentioned below to hide the extra option.
Hope it helps anybody else.