Make WordPress Core

Opened 11 years ago

Closed 11 years ago

#15076 closed enhancement (wontfix)

wp_query->query_vars should hold taxonomy and term for post_tag and category archives

Reported by: joostdevalk Owned by: scribu
Milestone: Priority: normal
Severity: normal Version: 3.1
Component: Query Keywords: haspatch
Focuses: Cc:


wp_query->query_vars holds two variables, taxonomy and term, for custom taxonomy archives. These two variables don't exist in post_tag and category archives, and were they there, it might be easier to treat all taxonomies the same.

Attachments (1)

tax-term.patch (1.2 KB) - added by joostdevalk 11 years ago.

Download all attachments as: .zip

Change History (4)

11 years ago


#1 @joostdevalk
11 years ago

  • Keywords haspatch added

Added very simple, and probably wrong patch, tested on trunk with twentyten and it doesn't seem to cause any weirdness (which is not to be expected either, it's just adding two variables nothing else).

#2 @scribu
11 years ago

  • Owner set to scribu
  • Status changed from new to accepted

I think you forgot to remove the debug code from the theme header.

#3 @scribu
11 years ago

  • Milestone Awaiting Review deleted
  • Resolution set to wontfix
  • Status changed from accepted to closed

It is wrong, since with permalinks on, for example, 'cat' is not set.

Anyway, I think we should move away from 'taxonomy' and 'term' query vars, since now you can query multiple taxonomies.

Also, you can use $wp_query->get_queried_object().

Note: See TracTickets for help on using tickets.