WordPress 中文文档
Function Reference/cat is ancestor of
From WordPress Chinese
[编辑]
Description
This is a simple function for evaluating if the second category is descended from of another category.
[编辑]
Usage
%%% <?php cat_is_ancestor_of(cat1, cat2); ?> %%%
Returns true if cat1 is an ancestor of cat2. Any level of ancestry will return true.
Arguments should be either integer category IDs or category objects.
[编辑]
Notes
If arguments are string representations of integers and not true integers cat_is_ancestor_of will return false.
