WordPress.org

Make WordPress Core

Ticket #36510: 36510.3.diff

File 36510.3.diff, 1.2 KB (added by swissspidy, 3 years ago)
  • src/wp-includes/post-template.php

    diff --git src/wp-includes/post-template.php src/wp-includes/post-template.php
    index a441d74..3da4245 100644
    function get_body_class( $class = '' ) { 
    582582                $classes[] = 'attachment';
    583583        if ( is_404() )
    584584                $classes[] = 'error404';
    585         if ( is_singular() ) {
    586                 $classes[] = 'singular';
    587         }
    588585
    589586        if ( is_single() ) {
    590587                $post_id = $wp_query->get_queried_object_id();
  • tests/phpunit/tests/post/getBodyClass.php

    diff --git tests/phpunit/tests/post/getBodyClass.php tests/phpunit/tests/post/getBodyClass.php
    index 3e3b861..7401ce6 100644
    class Tests_Post_GetBodyClass extends WP_UnitTestCase { 
    8080
    8181        /**
    8282         * @ticket 35164
     83         * @ticket 36510
    8384         */
    8485        public function test_singular_body_classes() {
    8586                $post_id = self::factory()->post->create();
    class Tests_Post_GetBodyClass extends WP_UnitTestCase { 
    8990                $this->assertContains( "single-post", $class );
    9091                $this->assertContains( "postid-{$post_id}", $class );
    9192                $this->assertContains( "single-format-standard", $class );
    92                 $this->assertContains( "singular", $class );
    93 
    9493        }
    9594
    9695}