Make WordPress Core

Changeset 25745


Ignore:
Timestamp:
10/09/2013 07:13:28 PM (11 years ago)
Author:
nacin
Message:

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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/post-template.php

    r25602 r25745  
    459459        if ( is_post_type_archive() ) {
    460460            $classes[] = 'post-type-archive';
    461             foreach ( (array) get_query_var( 'post_type' ) as $post_type )
    462                 $classes[] = 'post-type-archive-' . sanitize_html_class( $post_type );
     461            $post_type = get_query_var( 'post_type' );
     462            if ( is_array( $post_type ) )
     463                $post_type = reset( $post_type );
     464            $classes[] = 'post-type-archive-' . sanitize_html_class( $post_type );
    463465        } else if ( is_author() ) {
    464466            $author = $wp_query->get_queried_object();
Note: See TracChangeset for help on using the changeset viewer.