Make WordPress Core

Ticket #36327: 36327.diff

File 36327.diff, 2.9 KB (added by ocean90, 10 years ago)
  • src/wp-includes/general-template.php

     
    876876        }
    877877
    878878        $custom_logo_id = get_theme_mod( 'custom_logo' );
    879         $size           = get_theme_support( 'custom-logo', 'size' );
    880879
    881         if ( ! $size ) {
    882                 $size = 'full';
    883         }
    884 
    885880        // We have a logo. Logo is go.
    886881        if ( $custom_logo_id ) {
    887882                $html = sprintf( '<a href="%1$s" class="custom-logo-link" rel="home" itemprop="url">%2$s</a>',
    888883                        esc_url( home_url( '/' ) ),
    889                         wp_get_attachment_image( $custom_logo_id, $size, false, array(
    890                                 'class'     => "custom-logo attachment-$size",
    891                                 'data-size' => $size,
     884                        wp_get_attachment_image( $custom_logo_id, 'full', false, array(
     885                                'class'     => 'custom-logo',
    892886                                'itemprop'  => 'logo',
    893887                        ) )
    894888                );
     
    896890
    897891        // If no logo is set but we're in the Customizer, leave a placeholder (needed for the live preview).
    898892        elseif ( is_customize_preview() ) {
    899                 $html = sprintf( '<a href="%1$s" class="custom-logo-link" style="display:none;"><img class="custom-logo" data-size="%2$s" /></a>',
    900                         esc_url( home_url( '/' ) ),
    901                         esc_attr( $size )
     893                $html = sprintf( '<a href="%1$s" class="custom-logo-link" style="display:none;"><img class="custom-logo"/></a>',
     894                        esc_url( home_url( '/' ) )
    902895                );
    903896        }
    904897
     
    912905         * @since 4.5.0
    913906         *
    914907         * @param string $html Custom logo HTML output.
    915          * @param string $size Size specified in add_theme_support declaration, or 'full' default.
    916908         */
    917         return apply_filters( 'get_custom_logo', $html, $size );
     909        return apply_filters( 'get_custom_logo', $html );
    918910}
    919911
    920912/**
  • tests/phpunit/tests/general/template.php

     
    279279
    280280                $this->_set_custom_logo();
    281281                $home_url = get_home_url( $blog_id, '/' );
    282                 $size     = get_theme_support( 'custom-logo', 'size' );
    283                 $size     = $size ? $size : 'full';
    284                 $image    = wp_get_attachment_image( $this->custom_logo_id, $size, false, array(
    285                         'class'     => "custom-logo attachment-$size",
    286                         'data-size' => $size,
     282                $image    = wp_get_attachment_image( $this->custom_logo_id, 'full', false, array(
     283                        'class'     => 'custom-logo',
    287284                        'itemprop'  => 'logo',
    288285                ) );
    289286                restore_current_blog();
     
    302299                the_custom_logo();
    303300
    304301                $this->_set_custom_logo();
    305                 $size  = get_theme_support( 'custom-logo', 'size' );
    306                 $size  = $size ? $size : 'full';
    307                 $image = wp_get_attachment_image( $this->custom_logo_id, $size, false, array(
    308                         'class'     => "custom-logo attachment-$size",
    309                         'data-size' => $size,
     302                $image = wp_get_attachment_image( $this->custom_logo_id, 'full', false, array(
     303                        'class'     => 'custom-logo',
    310304                        'itemprop'  => 'logo',
    311305                ) );
    312306