[wp-trac] [WordPress Trac] #25341: multiple custom post types in pre_get_post filter break body_class

WordPress Trac noreply at wordpress.org
Tue Sep 17 21:30:12 UTC 2013


#25341: multiple custom post types in pre_get_post filter break body_class
------------------------------+-----------------------------
 Reporter:  norcross          |       Owner:  SergeyBiryukov
     Type:  defect (bug)      |      Status:  reopened
 Priority:  normal            |   Milestone:  3.7
Component:  Template          |     Version:  3.1
 Severity:  normal            |  Resolution:
 Keywords:  has-patch commit  |
------------------------------+-----------------------------

Comment (by SergeyBiryukov):

 Replying to [comment:6 nacin]:
 > is_post_type_archive is only set to true when `if ( !empty(
 $qv['post_type'] ) && ! is_array( $qv['post_type'] ) ) {`.

 Right, but the code attached to `pre_get_posts` (which makes `post_type`
 an array) runs after that, not before.

 Replying to [comment:6 nacin]:
 > Could anyone actually reproduce this in 3.6?

 I was able to reproduce the `post-type-archive-Array` class in both 3.6
 and 3.6.1.

 Also got a notice from [source:tags/3.6.1/wp-includes/post.php#L1038
 get_post_type_object()], which appears to be fixed in [25312]:
 {{{
 Warning: Illegal offset type in isset or empty in wp-includes/post.php on
 line 1038
 }}}

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


More information about the wp-trac mailing list