Get The Post Type A Taxonomy Is Attached To
If we peek into the global $wp_taxonomies variable we see the associated object types. There might be better ways to do this or even core functions, but you could try the following: function wpse_172645_get_post_types_by_taxonomy( $tax = ‘category’ ) { global $wp_taxonomies; return ( isset( $wp_taxonomies[$tax] ) ) ? $wp_taxonomies[$tax]->object_type : array(); } then for the … Read more