函数原型
is_taxonomy_viewable( string|WP_Taxonomy $taxonomy ): bool
函数描述
Determines whether a taxonomy is considered “viewable”.
是否弃用
未弃用
函数参数
-
$taxonomy
string|WP_Taxonomy
Required -
Taxonomy name or object.
函数返回值
bool Whether the taxonomy should be considered viewable.
函数位置
File: wp-includes/taxonomy.php
.
函数源码
function is_taxonomy_viewable( $taxonomy ) {
if ( is_scalar( $taxonomy ) ) {
$taxonomy = get_taxonomy( $taxonomy );
if ( ! $taxonomy ) {
return false;
}
}
return $taxonomy->publicly_queryable;
}
源码链接
变更日志
Version | Description |
---|---|
5.1.0 | Introduced. |