On this page
is_taxonomy_viewable( string|WP_Taxonomy $taxonomy ): bool
Determines whether a taxonomy is considered “viewable”.
Parameters
$taxonomystring|WP_Taxonomy Required-
Taxonomy name or object.
Return
bool Whether the taxonomy should be considered viewable.
Source
File: wp-includes/taxonomy.php. View all references
function is_taxonomy_viewable( $taxonomy ) {
if ( is_scalar( $taxonomy ) ) {
$taxonomy = get_taxonomy( $taxonomy );
if ( ! $taxonomy ) {
return false;
}
}
return $taxonomy->publicly_queryable;
}
Related
Uses
| Uses | Description |
|---|---|
| get_taxonomy() wp-includes/taxonomy.php | Retrieves the taxonomy object of $taxonomy. |
Used By
| Used By | Description |
|---|---|
| is_term_publicly_viewable() wp-includes/taxonomy.php | Determines whether a term is publicly viewable. |
| build_query_vars_from_query_block() wp-includes/blocks.php | Helper function that constructs a WP_Query args array from a |
Changelog
| Version | Description |
|---|---|
| 5.1.0 | Introduced. |
© 2003–2022 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/functions/is_taxonomy_viewable