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
This commit is contained in:
parent
af0282891d
commit
68b8f41780
|
@ -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
|
||||
|
|
|
@ -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.
|
||||
|
|
Loading…
Reference in New Issue