Core Function
View Source on Trac ↗ term_is_ancestor_of()
term_is_ancestor_of( mixed $term1, mixed $term2, mixed $taxonomy ) Checks if a term is an ancestor of another term.
Parameters 3 required
| Name / Type | Description |
|---|---|
| (int | | object) $term1 ID or object to check if this is the parent term. Required |
| (int | | object) $term2 The child term. Required |
| $taxonomy string | Taxonomy name that $term1 and `$term2` belong to. Required |
Return Value
(bool)
Whether `$term2` is a child of `$term1`.
Function Information
Since Version
3.4.0
Source File
wp-includes/taxonomy.php
Advertisement