Only add one body class when multiple post types manage to be present for a post type archive due to pre_get_posts manipulation.

fixes #25341.


git-svn-id: https://develop.svn.wordpress.org/trunk@25745 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Andrew Nacin 2013-10-09 19:13:28 +00:00
parent 12cb3a353e
commit 3a46ff98f5
1 changed files with 4 additions and 2 deletions

View File

@ -458,8 +458,10 @@ function get_body_class( $class = '' ) {
} elseif ( is_archive() ) {
if ( is_post_type_archive() ) {
$classes[] = 'post-type-archive';
foreach ( (array) get_query_var( 'post_type' ) as $post_type )
$classes[] = 'post-type-archive-' . sanitize_html_class( $post_type );
$post_type = get_query_var( 'post_type' );
if ( is_array( $post_type ) )
$post_type = reset( $post_type );
$classes[] = 'post-type-archive-' . sanitize_html_class( $post_type );
} else if ( is_author() ) {
$author = $wp_query->get_queried_object();
$classes[] = 'author';