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

git-svn-id: http://core.svn.wordpress.org/trunk@21508 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Ryan Boren 2012-08-14 19:24:36 +00:00
parent 8eb21fd381
commit 77fdb14c2c
2 changed files with 8 additions and 1 deletions

View File

@ -4608,6 +4608,7 @@ h3.available-themes {
.appearance_page_custom-header #headimg {
border: 1px solid #DFDFDF;
overflow: hidden;
width: 100%;
}

View File

@ -510,8 +510,14 @@ var farbtastic;
<?php if ( $this->admin_image_div_callback ) {
call_user_func( $this->admin_image_div_callback );
} else {
$custom_header = get_custom_header();
$header_image_style = 'background-image:url(' . esc_url( get_header_image() ) . ');';
if ( $custom_header->width )
$header_image_style .= 'max-width:' . $custom_header->width . 'px;';
if ( $custom_header->height )
$header_image_style .= 'height:' . $custom_header->height . 'px;';
?>
<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;">
<div id="headimg" style="<?php echo $header_image_style; ?>">
<?php
if ( display_header_text() )
$style = ' style="color:#' . get_header_textcolor() . ';"';