Make WordPress Core

Opened 14 years ago

Closed 14 years ago

#15978 closed defect (bug) (fixed)

taxonomy/term query var not set for singular views

Reported by: dd32's profile dd32 Owned by:
Milestone: 3.1 Priority: normal
Severity: normal Version: 3.1
Component: Query Keywords: regression has-patch
Focuses: Cc:

Description

The backcompat taxonomy and term query vars are not set on singular views, they're only being set on taxonomy archives.

This has the result that certain plugins which add taxonomies to the URL are affected.

Best to test without Pretty Permalinks enabled:

3.0: http://localhost/wordpress-30-commit/?p=18&colour=red
    array
      'p' => int 18
      'colour' => string 'red' (length=3)
      'taxonomy' => string 'colour' (length=6)
      'term' => string 'red' (length=3)
3.1: http://localhost/wordpress-commit/?p=483&colour=red
before patch:
    array
      'p' => int 483
      'colour' => string 'red' (length=3)
taxonomy/term unset.

after patch:
    array
      'p' => int 483
      'colour' => string 'red' (length=3)
...
      'taxonomy' => string 'colour' (length=6)
      'term' => string 'red' (length=3)

(Those are both looking at $wp_query->query_vars directly in header.php)

Attachments (2)

15978.patch (469 bytes) - added by dd32 14 years ago.
15978.2.patch (478 bytes) - added by dd32 14 years ago.

Download all attachments as: .zip

Change History (5)

@dd32
14 years ago

#1 @nacin
14 years ago

Looks good.

#2 @dd32
14 years ago

i'm not sure if that should be testing $this->tax_query->queries or $this->tax_query, they appear the same to be in testing (tax_query is simply unset) however, the first is used elsewhere.

@dd32
14 years ago

#3 @dd32
14 years ago

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

(In [17147]) Set taxonomy/term back-compat query vars for all views (not just taxonomy indexes). Fixes #15978

Note: See TracTickets for help on using tickets.