确定分类名称是否存在。
原型
taxonomy_exists( string $taxonomy )
描述
以前的is_taxonomy(),在2.3.0中引入。
参数
$taxonomy
(string)
(Required)
分类对象的名称。
返回值
(bool)
分类是否存在。
源文件
路径:wp-includes/taxonomy.php
<?php
...
function taxonomy_exists( $taxonomy ) {
global $wp_taxonomies;
return isset( $wp_taxonomies[$taxonomy] );
}
...
?>
其他
英文文档:https://developer.wordpress.org/reference/functions/taxonomy_exists/