[wp-trac] [WordPress Trac] #20647: get_post_type() returns nothing on custom post type archive pages with custom query and no results

WordPress Trac wp-trac at lists.automattic.com
Wed May 9 22:42:13 UTC 2012


#20647: get_post_type() returns nothing on custom post type archive pages with
custom query and no results
-----------------------------+------------------------------
 Reporter:  MikevHoenselaar  |       Owner:  MikevHoenselaar
     Type:  defect (bug)     |      Status:  closed
 Priority:  normal           |   Milestone:
Component:  Post Types       |     Version:  3.3.2
 Severity:  normal           |  Resolution:  invalid
 Keywords:  needs-patch      |
-----------------------------+------------------------------

Comment (by scribu):

 Also note that `get_query_var( 'post_type' )` can return an array. That's
 probably something most plugins aren't prepared for either.

 So, my suggestion is that they should decide what they want: the post type
 of a certain post or the post type from the query vars? In the unlikely
 case when they would want both, they can just call both functions.

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


More information about the wp-trac mailing list