WordPress.org

Make WordPress Core

Opened 4 years ago

Closed 4 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:

Description

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 4 years ago.
Patch

Download all attachments as: .zip

Change History (4)

joostdevalk4 years ago

Patch

comment:1 joostdevalk4 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).

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

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