cat_is_ancestor_of


cat_is_ancestor_of ( $cat1, $cat2 )

Parameters:
  • (int|object) cat1 ID or object to check if this is the parent category.
  • (int|object) cat2 The child category.
Returns:
  • (bool) Whether $cat2 is child of $cat1.
Defined at:

Description

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.

Related Functions

term_is_ancestor_of, get_post_ancestors, _get_post_ancestors, get_ancestors, has_custom_logo

Top Google Results

User discussions

wpseek mobile