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: https://develop.svn.wordpress.org/trunk@21508 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Ryan Boren 2012-08-14 19:24:36 +00:00
parent a6015df392
commit 082f515280
2 changed files with 8 additions and 1 deletions

View File

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

View File

@ -510,8 +510,14 @@ var farbtastic;
<?php if ( $this->admin_image_div_callback ) { <?php if ( $this->admin_image_div_callback ) {
call_user_func( $this->admin_image_div_callback ); call_user_func( $this->admin_image_div_callback );
} else { } 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 <?php
if ( display_header_text() ) if ( display_header_text() )
$style = ' style="color:#' . get_header_textcolor() . ';"'; $style = ' style="color:#' . get_header_textcolor() . ';"';