cat_is_ancestor_of()

最后更新于:2021-11-25 20:27:48

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

Checks if a category is an ancestor of another category.

参数

$cat1

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

$cat2

(int|object) (Required) The child category.

响应

(bool) Whether $cat2 is child of $cat1.

源文件

文件: gc-includes/category.php

function cat_is_ancestor_of( $cat1, $cat2 ) {
	return term_is_ancestor_of( $cat1, $cat2, 'category' );
}