WordPress.org

Make WordPress Core

Ticket #36510: 36510.patch

File 36510.patch, 724 bytes (added by davidakennedy, 3 years ago)

Remove singular class if it exist, then add it where needed in twentyeleven_body_classes.

  • wp-content/themes/twentyeleven/functions.php

     
    697697        if ( function_exists( 'is_multi_author' ) && ! is_multi_author() )
    698698                $classes[] = 'single-author';
    699699
     700        // If the singular class already exist (in WordPress 4.4 and above), remove it.
     701        $index = array_search( 'singular', $classes );
     702        if ( false !== $index ) {
     703                unset( $classes[ $index ] );
     704        }
     705
    700706        if ( is_singular() && ! is_home() && ! is_page_template( 'showcase.php' ) && ! is_page_template( 'sidebar-page.php' ) )
    701707                $classes[] = 'singular';
    702708