Make WordPress Core

Ticket #37011: 37011.patch

File 37011.patch, 1.1 KB (added by Soean, 7 years ago)

First patch

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

     
    879879
    880880        // We have a logo. Logo is go.
    881881        if ( $custom_logo_id ) {
    882                 $html = sprintf( '<a href="%1$s" class="custom-logo-link" rel="home" itemprop="url">%2$s</a>',
    883                         esc_url( home_url( '/' ) ),
    884                         wp_get_attachment_image( $custom_logo_id, 'full', false, array(
    885                                 'class'    => 'custom-logo',
    886                                 'itemprop' => 'logo',
    887                         ) )
    888                 );
     882                $custom_logo = wp_get_attachment_image( $custom_logo_id, 'full', false, array(
     883                        'class'    => 'custom-logo',
     884                        'itemprop' => 'logo',
     885                ) );
     886                if ( is_front_page() ) {
     887                        $html = $custom_logo;
     888
     889                // If not on the front page, link the logo to home.
     890                } else {
     891                        $html = sprintf( '<a href="%1$s" class="custom-logo-link" rel="home" itemprop="url">%2$s</a>',
     892                                esc_url( home_url( '/' ) ),
     893                                $custom_logo
     894                        );
     895                }
    889896        }
    890897
    891898        // If no logo is set but we're in the Customizer, leave a placeholder (needed for the live preview).