I'm testing the function wp_list_filter()
, basically I want to know if post_type has some specific feature before making stuffs.
So I end up with this:
public static function get_post_types_with_support( $feature ) {
global $_wp_post_type_features;
$post_types = wp_list_filter( $_wp_post_type_features, array( $feature => 1 ) );
return $post_types;
}
The problem is I do not understand why I can't get it working with custom post type while I gave some specific support to them.
For example, book post_type supports thumbnails, but I do not have it in my array when I display it. Where am I wrong?
EDIT : by feature I mean support. If my post_type supports this feature then I can use it. My function is supposed to return array with post_types that support my feature e.g thumbnail