term_is_ancestor_of


term_is_ancestor_of ( $term1, $term2, $taxonomy )

Parameters:
  • (int|object) term1 ID or object to check if this is the parent term.
  • (int|object) term2 The child term.
  • (string) taxonomy Taxonomy name that $term1 and `$term2` belong to.
Returns:
  • (bool) Whether `$term2` is a child of `$term1`.
Defined at:

Description

Checks if a term is an ancestor of another term.You can use either an ID or the term object for both parameters.

Related Functions

cat_is_ancestor_of, get_post_ancestors, get_ancestors, _get_post_ancestors, permalink_anchor

Top Google Results

User discussions

wpseek mobile