Summery Summery
Checks if a category is an ancestor of another category.
Syntax Syntax
Description Description
You can use either an ID or the category object for both parameters. If you use an integer, the category will be retrieved.
Parameters Parameters
- $cat1
-
(Required) ID or object to check if this is the parent category.
- $cat2
-
(Required) The child category.
Return Return
(bool) Whether $cat2 is child of $cat1.
Source Source
File: wp-includes/category.php
* Sanitizes category data based on context. * * @since 2.3.0
Advertisement
Changelog Changelog
Version | Description |
---|---|
2.1.0 | Introduced. |