WordPress.org

Make WordPress Core

Ticket #21130: 21130-2.patch

File 21130-2.patch, 991 bytes (added by JarretC, 22 months ago)
  • wp-admin/custom-header.php

     
    510510        <?php if ( $this->admin_image_div_callback ) { 
    511511          call_user_func( $this->admin_image_div_callback ); 
    512512        } else { 
     513                $header_image_style = 'background-image:url(' . esc_url( get_header_image() ) . ');'; 
     514                if ( get_custom_header()->width ) 
     515                        $header_image_style .= ' max-width:' . get_custom_header()->width . 'px;'; 
     516                if ( get_custom_header()->height ) 
     517                        $header_image_style .= ' height:auto'; 
    513518        ?> 
    514         <div id="headimg" style="background-image:url(<?php esc_url ( header_image() ) ?>);max-width:<?php echo get_custom_header()->width; ?>px;height:<?php echo get_custom_header()->height; ?>px;"> 
     519        <div id="headimg" style="<?php echo $header_image_style; ?>"> 
    515520                <?php 
    516521                if ( display_header_text() ) 
    517522                        $style = ' style="color:#' . get_header_textcolor() . ';"';