[wp-trac] [WordPress Trac] #35089: Query var on non-public taxonomy remains boolean true since [35333]
WordPress Trac
noreply at wordpress.org
Tue Dec 15 01:26:01 UTC 2015
#35089: Query var on non-public taxonomy remains boolean true since [35333]
--------------------------+------------------------------------------
Reporter: johnbillion | Owner:
Type: defect (bug) | Status: new
Priority: normal | Milestone: 4.4.1
Component: Taxonomy | Version: 4.4
Severity: normal | Keywords: needs-patch needs-unit-tests
Focuses: |
--------------------------+------------------------------------------
Still trying to pin down the root cause of this one. Steps to reproduce:
1. Register a non-public custom taxonomy with the following code:
{{{
register_taxonomy( 'foo', 'post', array(
'public' => false,
'query_var' => true,
) );
}}}
2. Call the following code on the front end of your site:
{{{
var_dump( get_taxonomies( array(
'query_var' => 'bar',
), 'objects' ) );
}}}
Note that the output erroneously contains the `foo` taxonomy, despite its
query var not matching. The taxonomy's query var remains as boolean
`true`, whereas in <=4.3 it was converted to the taxonomy name (`foo` in
this example).
The query var for a non-public taxonomy should probably be set to boolean
`false` in this case.
This seems to have been introduced in [35333]. The problem does not occur
in the admin area due to a tweak introduced in [35680].
--
Ticket URL: <https://core.trac.wordpress.org/ticket/35089>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list