Make WordPress Core


Ignore:
Timestamp:
02/13/2016 03:50:37 AM (9 years ago)
Author:
boonebgorges
Message:

Introduce publicly_queryable taxonomy argument.

Taxonomies registered as publicly_queryable can be queried as taxonomy
archives.

If not provided explicitly, the value of publicly_queryable is inherited
from public.

Props Chouby.
Fixes #34491.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/class-wp.php

    r36365 r36525  
    332332                $this->query_vars[$t->query_var] = str_replace( ' ', '+', $this->query_vars[$t->query_var] );
    333333
    334         // Don't allow non-public taxonomies to be queried from the front-end.
     334        // Don't allow non-publicly queryable taxonomies to be queried from the front-end.
    335335        if ( ! is_admin() ) {
    336             foreach ( get_taxonomies( array( 'public' => false ), 'objects' ) as $taxonomy => $t ) {
     336            foreach ( get_taxonomies( array( 'publicly_queryable' => false ), 'objects' ) as $taxonomy => $t ) {
    337337                /*
    338338                 * Disallow when set to the 'taxonomy' query var.
    339                  * Non-public taxonomies cannot register custom query vars. See register_taxonomy().
     339                 * Non-publicly queryable taxonomies cannot register custom query vars. See register_taxonomy().
    340340                 */
    341341                if ( isset( $this->query_vars['taxonomy'] ) && $taxonomy === $this->query_vars['taxonomy'] ) {
Note: See TracChangeset for help on using the changeset viewer.