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: - Introduced in WordPress: 3.4.0
- Deprecated in WordPress: —
Description
Checks if a term is an ancestor of another term.You can use either an ID or the term object for both parameters.