The code below can be used to get the post types for a taxonomy in WordPress. This is useful if you know the taxonomy and want to get the post types associated with it.

To do the opposite of this (get the taxonomies for a post type), see get_object_taxonomies().

Leave a reply

Your email address will not be published. Required fields are marked *