Make WordPress Core

Ticket #44466: 44466-2.diff

File 44466-2.diff, 666 bytes (added by andizer, 6 years ago)
  • wp-includes/taxonomy.php

     
    45484548
    45494549        return $parent;
    45504550}
     4551
     4552/**
     4553 * Determines whether a taxonomy is considered "viewable".
     4554 * *
     4555 * @param string|WP_Taxonomy $taxonomy Taxonomy name or object.
     4556 * @return bool Whether the taxonomy should be considered viewable.
     4557 */
     4558function is_taxonomy_viewable( $taxonomy ) {
     4559        if ( is_scalar( $taxonomy ) ) {
     4560                $taxonomy = get_taxonomy( $taxonomy );
     4561                if ( ! $taxonomy ) {
     4562                        return false;
     4563                }
     4564        }
     4565
     4566        return $taxonomy->publicly_queryable;
     4567}