WordPress: Function Reference/cat is ancestor of:修订间差异
来自站长百科
(新页面: == Description == This is a simple function for evaluating if the second category is a child of another category. == Usage == %%% <?php cat_is_ancestor_of(cat1, cat2); ?> %%% Returns ...) |
(→注意) |
||
(未显示2个用户的2个中间版本) | |||
第1行: | 第1行: | ||
== | == 描述 == | ||
这是个简单的函数,用来评价第二个类别是不是另一个类别的子类别。 | |||
== | == 用法== | ||
%%% <?php cat_is_ancestor_of(cat1, cat2); ?> %%% | %%% <?php cat_is_ancestor_of(cat1, cat2); ?> %%% | ||
如果cat1是cat2的上一级,返回正确的。任何级别系统都会返回正确的。 | |||
参数应该是类别整数ID或者类别objects。 | |||
== | == 注意== | ||
如果参数是整数的字符串形式而不是真正的整数,'''cat_is_ancestor_of '''会返回false的。 | |||
== 深入阅读 == | |||
== | * [[WordPress:Function_Reference|Function_Reference]] | ||
* [[WordPress:Function_Reference]] |