is_term() - WordPress 函数参考中文文档

返回介绍

is_term()

发布于 2017-09-11 字数1550 浏览 914 评论 0

Warning: This function has been deprecated. Use term_exists() instead.

is_term( int|string $term,  string $taxonomy = '',  int $parent )

Check if Term exists.


描述


参数

$term

(int|string)
(Required)
The term to check

$taxonomy

(string)
(Optional)
The taxonomy name to use

Default value: ”

$parent

(int)
(Required)
ID of parent term under which to confine the exists search.


返回值

(mixed) Get the term id or Term Object, if exists.


源代码

File: wp-includes/deprecated.php

function is_term( $term, $taxonomy = '', $parent = 0 ) {
	_deprecated_function( __FUNCTION__, '3.0.0', 'term_exists()' );
	return term_exists( $term, $taxonomy, $parent );
}

更新日志

Version 描述
3.0.0 Use term_exists()
2.3.0 Introduced.

相关函数

Uses

  • wp-includes/functions.php:
    _deprecated_function()
  • wp-includes/taxonomy.php:
    term_exists()

User Contributed Notes

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

目前还没有任何评论,快来抢沙发吧!