WordPress.org

Make WordPress Core

Changeset 21508


Ignore:
Timestamp:
08/14/12 19:24:36 (20 months 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

Location:
trunk/wp-admin
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/css/wp-admin.dev.css

    r21461 r21508  
    46094609.appearance_page_custom-header #headimg { 
    46104610    border: 1px solid #DFDFDF; 
     4611    overflow: hidden; 
    46114612    width: 100%; 
    46124613} 
  • 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.