Languages: English • Italiano • 日本語 (Add your language)
Determines if the given object is associated with any of the given terms.
The given terms are checked against the object’s terms’ term_ids, names and slugs. Terms given as integers will only be checked against the object’s terms’ term_ids. If no terms are given, determines if object is associated with any terms in the given taxonomy.
<?php is_object_in_term( $object_id, $taxonomy, $terms = null ) ?>
<?php if ( is_object_in_term( $post->ID, 'custom_taxonomy_name', 'term_name' ) ) : echo 'YES'; else : echo 'NO'; endif; ?>
Since: 2.7.0
is_object_in_term() is located in wp-includes/taxonomy.php
.