is_taxonomy_viewable

The timeline below displays how wordpress function is_taxonomy_viewable has changed across different WordPress versions. If a version is not listed, refer to the next available version below.

WordPress Version: 5.1

/**
 * Determines whether a taxonomy is considered "viewable".
 *
 * @since 5.1.0
 *
 * @param string|WP_Taxonomy $taxonomy Taxonomy name or object.
 * @return bool Whether the taxonomy should be considered viewable.
 */
function is_taxonomy_viewable($taxonomy)
{
    if (is_scalar($taxonomy)) {
        $taxonomy = get_taxonomy($taxonomy);
        if (!$taxonomy) {
            return false;
        }
    }
    return $taxonomy->publicly_queryable;
}