Make WordPress Core

Timestamp:
11/04/2013 11:53:55 PM (13 years ago)
Author:
wonderboymusic
Message:

Category and tag are typically checked before checking for a custom taxonomy. If the global query matches category or tag (even if it also has tax_query set), return category/tag as the queried object, instead of arbitrarily returning the first term in the tax_query stack (typically those added with 'pre_get_posts').

Real world example: http://www.emusic.com/17dots/topics/daily-download/ - "tag" page, regionalized for US-only content using pre_get_posts passing in the terms "US" and "ALL" for "region" (custom tax). All of the theme functions would output "ALL" as the term name. Even though it was a tag archive, the queried object was an arbitrary term from tax_query.

See [26006]. All unit tests pass.
Fixes #20767.

File:
1 added

Note: See TracChangeset for help on using the changeset viewer.