cat_is_ancestor_of

Advertisement

Summery Summery

Checks if a category is an ancestor of another category.

Syntax Syntax

cat_is_ancestor_of( int|object $cat1, int|object $cat2 )

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

(int|object) (Required) ID or object to check if this is the parent category.

$cat2

(int|object) (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

Changelog
Version Description
2.1.0 Introduced.

Advertisement

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.