Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

Is there a function that does something like:

is_in_taxonomy($term, $taxonomy)

Where it returns true if $taxonomy has that $term. ????

Thanks!

share|improve this question
add comment

2 Answers

up vote 2 down vote accepted

You're probably looking for term_exists():

<?php term_exists( $term, $taxonomy, $parent ); ?>

$term is required (obviously).

Both $taxonomy and $parent are optional, but if you want to determine if a specific taxonomy has a given term, just pass the registered taxonomy name via the $taxonomy parameter.

share|improve this answer
add comment

term_exists

term_exists( $term, $taxonomy );
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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