[wp-trac] [WordPress Trac] #18614: post_type_archive_title doesn't work when tax_query is added to wp_query

WordPress Trac wp-trac at lists.automattic.com
Wed Sep 7 20:07:28 UTC 2011


#18614: post_type_archive_title doesn't work when tax_query is added to wp_query
----------------------------+----------------------
 Reporter:  wonderboymusic  |       Owner:
     Type:  defect (bug)    |      Status:  closed
 Priority:  normal          |   Milestone:
Component:  Template        |     Version:  3.3
 Severity:  normal          |  Resolution:  wontfix
 Keywords:  has-patch       |
----------------------------+----------------------

Comment (by scribu):

 Yes, but do you know why it works?

 Because get_post_type() checks the $post global:

 http://core.trac.wordpress.org/browser/trunk/wp-includes/post.php#L786

 In other words, it's is to be used only within The Loop.

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


More information about the wp-trac mailing list