首页 WordPress函数大全 cat_is_ancestor_of()

cat_is_ancestor_of()

2020-05-02 / 5412阅 / 悠然

如何你看完本文还不知道如何使用该函数,可以联系我定制视频教程,50元/个函数,学不会全额退款

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

检查一个类别是否是另一个类别的祖先。

描述

您可以将id或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

大家谈论
    我的见解