Core Function
View Source on Trac ↗ cat_is_ancestor_of()
cat_is_ancestor_of( mixed $cat1, mixed $cat2 ) Checks if a category is an ancestor of another category.
Parameters 2 required
| Name / Type | Description |
|---|---|
| (int | | object) $cat1 ID or object to check if this is the parent category. Required |
| (int | | object) $cat2 The child category. Required |
Return Value
(bool)
Whether $cat2 is child of $cat1.
Function Information
Since Version
2.1.0
Source File
wp-includes/category.php
Advertisement