Registering different Post Formats for Blog Post and CPT

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. .post-type-portfolio #post-format-audio, /* for radio button itself */ .post-type-portfolio .post-format-audio /* for option label */ { display: none; … Read more

Adding `supports` array to WordPress custom post type

Use ‘supports’ => [ ‘title’, ‘editor’, ‘thumbnail’ ] – different values, not keys. If we look into register_post_type(), we find these lines: if ( ! empty( $args->supports ) ) { add_post_type_support( $post_type, $args->supports ); unset( $args->supports ); } elseif ( false !== $args->supports ) { // Add default features add_post_type_support( $post_type, array( ‘title’, ‘editor’ ) … Read more

wp_list_filter() and supports

As I noted on a comment and @toscho wrote in his answer, your code works if used after wp_loaded hook. The reason why it works for core post types if used on earlier hooks is WordPress register core post types 2 times: first time just after ‘mu_plugins_loaded’ hook and then again on ‘init’ hook (reference). … Read more

Only get post types based on support

I found out that get_post_types_by_support() seems to be the solution to get the desired result: $post_types = get_post_types_by_support(array(‘title’, ‘editor’, ‘thumbnail’)); The above will return post, page and any custom post type that supports title, editor and thumbnail. Since this will also return private post types, we could loop through the list and check if the … Read more