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 ...)
 
无编辑摘要
第1行: 第1行:
== Description ==
== Description ==
== 描述 ==


This is a simple function for evaluating if the second category is a child of another category.
This is a simple function for evaluating if the second category is a child of another category.
这是个简单的函数,用来第二个类别是不是另一个类别的子类别。


== Usage ==
== Usage ==
== 用法==
%%% <?php cat_is_ancestor_of(cat1, cat2); ?> %%%


%%% <?php cat_is_ancestor_of(cat1, cat2); ?> %%%
%%% <?php cat_is_ancestor_of(cat1, cat2); ?> %%%


Returns true if cat1 is an ancestor of cat2. Any level of ancestry will return true.
Returns true if cat1 is an ancestor of cat2. Any level of ancestry will return true.
如果cat1是cat2的上一级,返回正确的。任何级别系统都会返回正确的。


Arguments should be either integer category IDs or category objects.
Arguments should be either integer category IDs or category objects.
参数应该是类别整数ID或者类别objects。


== Notes ==  
== Notes ==  
== 注意==


If arguments are string representations of integers and not true integers '''cat_is_ancestor_of''' will return false.
If arguments are string representations of integers and not true integers '''cat_is_ancestor_of''' will return false.
如果参数是整数的字符串形式而不是真正的整数,'''cat_is_ancestor_of'''会返回错误的。




== Further Reading ==
== Further Reading ==
== 深入阅读 ==


* [[WordPress:Function_Reference]]
* [[WordPress:Function_Reference]]
* [[WordPress:Function_Reference|Function_Reference]]

2008年7月19日 (六) 16:17的版本

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); ?> %%%

%%% <?php cat_is_ancestor_of(cat1, cat2); ?> %%%

Returns true if cat1 is an ancestor of cat2. Any level of ancestry will return true.

如果cat1是cat2的上一级,返回正确的。任何级别系统都会返回正确的。

Arguments should be either integer category IDs or category objects.

参数应该是类别整数ID或者类别objects。

Notes

注意

If arguments are string representations of integers and not true integers cat_is_ancestor_of will return false.

如果参数是整数的字符串形式而不是真正的整数,cat_is_ancestor_of会返回错误的。


Further Reading

深入阅读