常用函数-is_term()

0条评论

常用函数-is_term()

说明

检查term是否存在。

返回已定义term的目录,term不存在时返回0(false)。

用法

<?php is_term( $term, $taxonomy ) ?>

参数

$term

(整数 | 字符串)(必需)需要检查的term

默认值:None

$taxonomy

(字符串)(必需)需要用到的分类法名称

默认值:''

返回的值

(混合)

获取存在的term编号或term对象。

示例

注释

  • 使用全局变量:(对象) $wpdb
  • 使用全局变量:(对象)$term

修改记录

自2.3.0版本后

源文件

is_term()位于 wp-includes/taxonomy.php中。

相关资源

发表新评论

此内容将保密,不会被其他人看见。
  • 自动将网址与电子邮件地址转变为链接。
  • 允许HTML标签:<a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • 自动断行和分段。

更多关於格式化选项的信息

CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.
Image CAPTCHA
Enter the characters shown in the image.