cat_is_ancestor_of
函数
cat_is_ancestor_of ( $cat1, $cat2 )
- 参数
-
-
(int|object)
$cat1
ID or object to check if this is the parent category.- Required: 是
-
(int|object)
$cat2
The child category.- Required: 是
-
(int|object)
- 返回值
-
- (bool) Whether $cat2 is child of $cat1.
- 定义位置
-
-
wp-includes/category.php
, line 246
-
wp-includes/category.php
- 引入
- 2.1.0
- 弃用
- –
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.
function cat_is_ancestor_of( $cat1, $cat2 ) { return term_is_ancestor_of( $cat1, $cat2, 'category' ); }
声明:本站所有文章,如无特殊说明或标注,均为本站原创发布。任何个人或组织,在未征得本站同意时,禁止复制、盗用、采集、发布本站内容到任何网站、书籍等各类媒体平台。如若本站内容侵犯了原著者的合法权益,可联系我们进行处理。