mirror of
https://github.com/WordPress/WordPress.git
synced 2024-12-23 01:27:36 +01:00
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. Built from https://develop.svn.wordpress.org/trunk@25745 git-svn-id: http://core.svn.wordpress.org/trunk@25658 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
f0eb99952c
commit
7b27a47e85
@ -458,8 +458,10 @@ function get_body_class( $class = '' ) {
|
|||||||
} elseif ( is_archive() ) {
|
} elseif ( is_archive() ) {
|
||||||
if ( is_post_type_archive() ) {
|
if ( is_post_type_archive() ) {
|
||||||
$classes[] = 'post-type-archive';
|
$classes[] = 'post-type-archive';
|
||||||
foreach ( (array) get_query_var( 'post_type' ) as $post_type )
|
$post_type = get_query_var( 'post_type' );
|
||||||
$classes[] = 'post-type-archive-' . sanitize_html_class( $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() ) {
|
} else if ( is_author() ) {
|
||||||
$author = $wp_query->get_queried_object();
|
$author = $wp_query->get_queried_object();
|
||||||
$classes[] = 'author';
|
$classes[] = 'author';
|
||||||
|
Loading…
Reference in New Issue
Block a user