函数原型
is_term( int|string $term, string $taxonomy = ”, int $parent ): mixed
函数描述
Check if Term exists.
是否弃用
Warning: This function has been deprecated. Use term_exists() instead.
函数参数
-
$term
int|string
Required -
The term to check
-
$taxonomy
string
Optional -
The taxonomy name to use
Default:
''
-
$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 | Description |
---|---|
3.0.0 | Use term_exists() |
2.3.0 | Introduced. |