[wp-trac] [WordPress Trac] #20767: tax_query clobbers tag and category

WordPress Trac noreply at wordpress.org
Mon Nov 4 23:53:56 UTC 2013


#20767: tax_query clobbers tag and category
------------------------------+-----------------------------
 Reporter:  wonderboymusic    |       Owner:  wonderboymusic
     Type:  defect (bug)      |      Status:  closed
 Priority:  normal            |   Milestone:  3.8
Component:  Query             |     Version:  3.1
 Severity:  major             |  Resolution:  fixed
 Keywords:  has-patch commit  |
------------------------------+-----------------------------
Changes (by wonderboymusic):

 * owner:   => wonderboymusic
 * status:  new => closed
 * resolution:   => fixed


Comment:

 In [changeset:"26007"]:
 {{{
 #!CommitTicketReference repository="" revision="26007"
 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.
 }}}

--
Ticket URL: <http://core.trac.wordpress.org/ticket/20767#comment:13>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list