1

I want to find all the taxonomies that match an array of CPT id's.

I have a taxonomy called location and I want to find all the locations where they have posts that are equal to my array of post id's e.g. array(12, 13, 18, 22, 343, 5644)

1 Answer 1

2

Easiest way to find terms of many posts is to use wp_get_object_terms function

$your_post_ids = array(12, 13, 18, 22, 343, 5644);
$your_taxonomy = 'location' //you can set many as array

$terms = wp_get_object_terms ( $your_post_ids, $your_taxonomy);

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.