Uses
Uses | Description |
---|---|
wp-includes/taxonomy.php: term_is_ancestor_of() | Check if a term is an ancestor of another term. |
Checks if a category is an ancestor of another category.
You can use either an ID or the category object for both parameters. If you use an integer, the category will be retrieved.
(int|object) (Required) ID or object to check if this is the parent category.
(int|object) (Required) The child category.
(bool) Whether $cat2 is child of $cat1.
File: wp-includes/category.php
function cat_is_ancestor_of( $cat1, $cat2 ) { return term_is_ancestor_of( $cat1, $cat2, 'category' ); }
Version | Description |
---|---|
2.1.0 | Introduced. |
© 2003–2019 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/functions/cat_is_ancestor_of