taxonomy_exists()
taxonomy_exists( string $taxonomy ) 确定分类名称是否存在。 Determi…
taxonomy_exists( string $taxonomy )
确定分类名称是否存在。
Determines whether the taxonomy name exists.
确定分类名称是否存在。
Determines whether the taxonomy name exists.
目录锚点:#说明#参数#源码#笔记
说明(Description)
以前是_taxonomy(),在2.3.0中引入。有关此主题函数和类似主题函数的更多信息,请参阅主题开发人员手册中的条件标记文章。
参数(Parameters)
| 参数 | 类型 | 说明 |
|---|---|---|
| $taxonomy | (string) | 分类对象的名称。 |
源码(Source)
/**
* Checks that the taxonomy name exists.
*
* Formerly is_taxonomy(), introduced in 2.3.0.
*
* @since 3.0.0
*
* @global array $wp_taxonomies The registered taxonomies.
*
* @param string $taxonomy Name of taxonomy object.
* @return bool Whether the taxonomy exists.
*/
function taxonomy_exists( $taxonomy ) {
global $wp_taxonomies;
return isset( $wp_taxonomies[$taxonomy] );
}| 更新版本 | 源码位置 | 使用 | 被使用 |
|---|---|---|---|
| 3.0.0 | wp-includes/taxonomy.php | 9 | 2 |
笔记(Notes)
基本示例
类别:WordPress 函数手册、
本文收集自互联网,转载请注明来源。
如有侵权,请联系 wper_net@163.com 删除。

还没有任何评论,赶紧来占个楼吧!