is_object_in_term


is_object_in_term ( $object_id, $taxonomy, $terms = null )

Parameters:
  • (int) object_id ID of the object (post ID, link ID, ...).
  • (string) taxonomy Single taxonomy name.
  • (int|string|int[]|string[]) terms Optional. Term ID, name, slug, or array of such to check against. Default null.
Returns:
  • (bool|WP_Error) WP_Error on input error.
Defined at:

Description

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.

Related Functions

get_objects_in_term, is_object_in_taxonomy, wp_set_object_terms, wp_add_object_terms, wp_get_object_terms

Top Google Results

User discussions

wpseek mobile