is_taxonomy_viewable()

最后更新于:2021-11-27 11:43:32

is_taxonomy_viewable( string|GC_Taxonomy$taxonomy)

Determines whether a taxonomy is considered “viewable”.

参数

$taxonomy

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

响应

(bool) Whether the taxonomy should be considered viewable.

源文件

文件: gc-includes/taxonomy.php

function is_taxonomy_viewable( $taxonomy ) {
	if ( is_scalar( $taxonomy ) ) {
		$taxonomy = get_taxonomy( $taxonomy );
		if ( ! $taxonomy ) {
			return false;
		}
	}

	return $taxonomy->publicly_queryable;
}