检查分类名称是否存在。
原型
is_taxonomy( string $taxonomy )
参数
$taxonomy
(string)
(Required)
分类对象的名称
返回值
(bool)
分类是否存在。
源文件
路径:wp-includes/deprecated.php
<?php
...
function is_taxonomy( $taxonomy ) {
_deprecated_function( __FUNCTION__, '3.0.0', 'taxonomy_exists()' );
return taxonomy_exists( $taxonomy );
}
...
?>
其他
英文文档:https://developer.wordpress.org/reference/functions/is_taxonomy/