From 4bd7394a2e3b78aa5cc0a21b5b2dcd635bf0bd98 Mon Sep 17 00:00:00 2001 From: "Dominik Schilling (ocean90)" Date: Tue, 19 Apr 2016 21:23:20 +0000 Subject: [PATCH] Themes: Revert [36112] Adding the `singular` class per default to the list of body classes is breaking the layout of Twenty Eleven and other themes. Twenty Eleven adds the `.singular` class only to single pages if the page doesn't use specific page templates. Props flixos90, swissspidy. Fixes #36510. git-svn-id: https://develop.svn.wordpress.org/trunk@37249 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-includes/post-template.php | 3 --- tests/phpunit/tests/post/getBodyClass.php | 3 +-- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/src/wp-includes/post-template.php b/src/wp-includes/post-template.php index a441d74231..3da42457c8 100644 --- a/src/wp-includes/post-template.php +++ b/src/wp-includes/post-template.php @@ -582,9 +582,6 @@ function get_body_class( $class = '' ) { $classes[] = 'attachment'; if ( is_404() ) $classes[] = 'error404'; - if ( is_singular() ) { - $classes[] = 'singular'; - } if ( is_single() ) { $post_id = $wp_query->get_queried_object_id(); diff --git a/tests/phpunit/tests/post/getBodyClass.php b/tests/phpunit/tests/post/getBodyClass.php index 3e3b861a64..7401ce6bf6 100644 --- a/tests/phpunit/tests/post/getBodyClass.php +++ b/tests/phpunit/tests/post/getBodyClass.php @@ -80,6 +80,7 @@ class Tests_Post_GetBodyClass extends WP_UnitTestCase { /** * @ticket 35164 + * @ticket 36510 */ public function test_singular_body_classes() { $post_id = self::factory()->post->create(); @@ -89,8 +90,6 @@ class Tests_Post_GetBodyClass extends WP_UnitTestCase { $this->assertContains( "single-post", $class ); $this->assertContains( "postid-{$post_id}", $class ); $this->assertContains( "single-format-standard", $class ); - $this->assertContains( "singular", $class ); - } }