Here’s another problem with WordPress post where you want to know whether a particular custom post has a particular taxonomy categories or tags. In a normal post cast, you will highly likely used either get_categories or get_terms but for custom post type you might need to use another method which is what i am using currently as well. In order to determine whether a post category or tag is used by your custom post type, try the following
$terms = wp_get_object_terms($post->ID, 'review_category');
The first parameter is obviously the post id but the second parameter here is actually the custom post type taxonomy which you can find on your custom post type ‘categories’ section (on the url). Once you have determine your taxonomy name, getting post taxonomy categories or tags should be a piece of cake.
No related posts.