From 68b8f41780f853478041796d1ee94fd53a3c0c74 Mon Sep 17 00:00:00 2001 From: Boone Gorges Date: Wed, 18 Nov 2015 19:59:49 +0000 Subject: [PATCH] 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. Built from https://develop.svn.wordpress.org/trunk@35680 git-svn-id: http://core.svn.wordpress.org/trunk@35644 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/taxonomy-functions.php | 3 ++- wp-includes/version.php | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/wp-includes/taxonomy-functions.php b/wp-includes/taxonomy-functions.php index 035f18b0d4..3d65ba3345 100644 --- a/wp-includes/taxonomy-functions.php +++ b/wp-includes/taxonomy-functions.php @@ -384,7 +384,8 @@ function register_taxonomy( $taxonomy, $object_type, $args = array() ) { return new WP_Error( 'taxonomy_length_invalid', __( 'Taxonomy names must be between 1 and 32 characters in length.' ) ); } - if ( false !== $args['query_var'] && false !== $args['public'] && ! empty( $wp ) ) { + // Non-public taxonomies should not register query vars, except in the admin. + if ( false !== $args['query_var'] && ( is_admin() || false !== $args['public'] ) && ! empty( $wp ) ) { if ( true === $args['query_var'] ) $args['query_var'] = $taxonomy; else diff --git a/wp-includes/version.php b/wp-includes/version.php index 325c8c49ed..f4442e8fab 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -4,7 +4,7 @@ * * @global string $wp_version */ -$wp_version = '4.4-beta4-35679'; +$wp_version = '4.4-beta4-35680'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.