From 082f515280c4585bb65264d9d2abfa829e776832 Mon Sep 17 00:00:00 2001 From: Ryan Boren Date: Tue, 14 Aug 2012 19:24:36 +0000 Subject: [PATCH] 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 --- wp-admin/css/wp-admin.dev.css | 1 + wp-admin/custom-header.php | 8 +++++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/wp-admin/css/wp-admin.dev.css b/wp-admin/css/wp-admin.dev.css index b1f0a7e3fd..1c68ce29df 100644 --- a/wp-admin/css/wp-admin.dev.css +++ b/wp-admin/css/wp-admin.dev.css @@ -4608,6 +4608,7 @@ h3.available-themes { .appearance_page_custom-header #headimg { border: 1px solid #DFDFDF; + overflow: hidden; width: 100%; } diff --git a/wp-admin/custom-header.php b/wp-admin/custom-header.php index aee52f199e..10a92df6b6 100644 --- a/wp-admin/custom-header.php +++ b/wp-admin/custom-header.php @@ -510,8 +510,14 @@ var farbtastic; 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;'; ?> -
+