WordPress.org

Make WordPress Core

Changeset 35680


Ignore:
Timestamp:
11/18/2015 07:58:21 PM (5 years ago)
Author:
boonebgorges
Message:

Allow filtering by non-public taxonomies on edit.php.

[35333] enforces protection for taxonomies by preventing non-public taxonomies
from registering query_vars in register_taxonomy(). This broke the use of
taxonomy query_vars on edit.php, breaking backward compatibility and
creating inconsistency with the treatment introduced in [34247], which allowed
taxonomy=foo filtering on the Dashboard, even when foo is non-public. In
this changeset, we make the same Dashboard exception for the query_var.

Fixes #21949.

File:
1 edited

Legend:

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

    r35585 r35680  
    385385    }
    386386
    387     if ( false !== $args['query_var'] && false !== $args['public'] && ! empty( $wp ) ) {
     387    // Non-public taxonomies should not register query vars, except in the admin.
     388    if ( false !== $args['query_var'] && ( is_admin() || false !== $args['public'] ) && ! empty( $wp ) ) {
    388389        if ( true === $args['query_var'] )
    389390            $args['query_var'] = $taxonomy;
Note: See TracChangeset for help on using the changeset viewer.