WordPress.org

Make WordPress Core

Ticket #36510: 36510.2.diff

File 36510.2.diff, 1.1 KB (added by flixos90, 3 years ago)

remove singular class, but not the get_body_class() unit test

  • src/wp-includes/post-template.php

     
    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

     
    7979        }
    8080
    8181        /**
    82          * @ticket 35164
     82         * @tickets 35164 + 36510
    8383         */
    8484        public function test_singular_body_classes() {
    8585                $post_id = self::factory()->post->create();
     
    8989                $this->assertContains( "single-post", $class );
    9090                $this->assertContains( "postid-{$post_id}", $class );
    9191                $this->assertContains( "single-format-standard", $class );
    92                 $this->assertContains( "singular", $class );
    93 
    9492        }
    9593
    9694}