is_taxonomy_viewable()
Determines whether a taxonomy is considered "viewable".
No Hooks.
Returns
true|false. Whether the taxonomy should be considered viewable.
Usage
is_taxonomy_viewable( $taxonomy );
- $taxonomy(string|WP_Taxonomy) (required)
- Taxonomy name or object.
Changelog
| Since 5.1.0 | Introduced. |
is_taxonomy_viewable() is taxonomy viewable code WP 7.0
function is_taxonomy_viewable( $taxonomy ) {
if ( is_scalar( $taxonomy ) ) {
$taxonomy = get_taxonomy( $taxonomy );
if ( ! $taxonomy ) {
return false;
}
}
return $taxonomy->publicly_queryable;
}