WordPress.org

Make WordPress Core

Opened 3 years ago

Closed 3 years ago

#15978 closed defect (bug) (fixed)

taxonomy/term query var not set for singular views

Reported by: 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 3 years ago.
15978.2.patch (478 bytes) - added by dd32 3 years ago.

Download all attachments as: .zip

Change History (5)

dd323 years ago

comment:1 nacin3 years ago

Looks good.

comment:2 dd323 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.

dd323 years ago

comment:3 dd323 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.