Make WordPress Core


Ignore:
Timestamp:
08/14/2012 07:24:36 PM (12 years ago)
Author:
ryan
Message:

Fix display issues in the custom header screen when height is not specified. Use get_header_image() instead of header_image() so that esc_url() can do its job. Props JarretC, SergeyBiryukov, georgestephanis. fixes #21130 #21433

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/custom-header.php

    r21502 r21508  
    511511      call_user_func( $this->admin_image_div_callback );
    512512    } else {
     513        $custom_header = get_custom_header();
     514        $header_image_style = 'background-image:url(' . esc_url( get_header_image() ) . ');';
     515        if ( $custom_header->width )
     516            $header_image_style .= 'max-width:' . $custom_header->width . 'px;';
     517        if ( $custom_header->height )
     518            $header_image_style .= 'height:' . $custom_header->height . 'px;';
    513519    ?>
    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;">
     520    <div id="headimg" style="<?php echo $header_image_style; ?>">
    515521        <?php
    516522        if ( display_header_text() )
Note: See TracChangeset for help on using the changeset viewer.