is_taxonomy_viewable( string|WP_Taxonomy $taxonomy )

Determines whether a taxonomy is considered “viewable”.


Description Description


Parameters Parameters

$taxonomy

(string|WP_Taxonomy) (Required) Taxonomy name or object.


Top ↑

Return Return

(bool) Whether the taxonomy should be considered viewable.


Top ↑

Source Source

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;
}

Top ↑

Changelog Changelog

Changelog
Version Description
5.1.0 Introduced.


Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.