Make WordPress Core

Opened 9 years ago

Closed 9 years ago

#35619 closed defect (bug) (fixed)

Queried object and Query vars are not consistent when querying two custom taxonomies

Reported by: chouby's profile Chouby Owned by: boonebgorges's profile boonebgorges
Milestone: 4.5 Priority: normal
Severity: normal Version: 4.1
Component: Query Keywords: has-patch has-unit-tests
Focuses: Cc:

Description

The queried object returns the first queried taxonomy (as expected) while the query vars $query->query_vars['taxonomy'] and $query->query_vars['term'] are unexpectedly related to the last queried taxonomy.

Attachments (2)

35619.patch (1.5 KB) - added by Chouby 9 years ago.
35619.2.patch (1.5 KB) - added by Chouby 9 years ago.

Download all attachments as: .zip

Change History (5)

@Chouby
9 years ago

#1 @Chouby
9 years ago

  • Keywords has-patch has-unit-tests added
Version 0, edited 9 years ago by Chouby (next)

@Chouby
9 years ago

#2 @boonebgorges
9 years ago

  • Milestone changed from Awaiting Review to 4.5
  • Version set to 4.1

Good catch. It looks like query_vars used to be set to the first one, but I accidentally changed it in [29891].

#3 @boonebgorges
9 years ago

  • Owner set to boonebgorges
  • Resolution set to fixed
  • Status changed from new to closed

In 36484:

WP_Query taxonomy query vars should be set to first of multiple taxonomies.

This provides better parity with get_queried_object(), which will return the
first taxonomy/term matched by the current query.

[29891] introduced the abnormal behavior for the 'taxonomy' and 'term'
query vars.

Props Chouby.
Fixes #35619.

Note: See TracTickets for help on using tickets.