From 2f3ebce172b2dbc7fadcb7d2a6ec7b055241c7a4 Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Sun, 29 Dec 2013 08:06:11 +0000 Subject: [PATCH] Always show Background Image section heading and the opening table tag on Custom Background screen, to make in consistent with Custom Header and avoid broken markup. props obenland. fixes #26731. Built from https://develop.svn.wordpress.org/trunk@26878 git-svn-id: http://core.svn.wordpress.org/trunk@26761 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/custom-background.php | 60 ++++++++++++++++++---------------- wp-admin/custom-header.php | 7 ++-- 2 files changed, 35 insertions(+), 32 deletions(-) diff --git a/wp-admin/custom-background.php b/wp-admin/custom-background.php index e5666e71c4..4b599f95ef 100644 --- a/wp-admin/custom-background.php +++ b/wp-admin/custom-background.php @@ -179,45 +179,47 @@ class Custom_Background { function admin_page() { ?>
-

-updated) ) { ?> +

+ +updated ) ) { ?>

Visit your site to see how it looks.' ), home_url( '/' ) ); ?>

- + +

- if ( $this->admin_image_div_callback ) { - call_user_func($this->admin_image_div_callback); - } else { -?> -

- + + @@ -243,8 +245,8 @@ if ( get_background_image() ) { - +
-admin_image_div_callback ) { + call_user_func( $this->admin_image_div_callback ); + } else { + $background_styles = ''; + if ( $bgcolor = get_background_color() ) + $background_styles .= 'background-color: #' . $bgcolor . ';'; -if ( get_background_image() ) { - $background_image_thumb = esc_url( set_url_scheme( get_theme_mod( 'background_image_thumb', str_replace( '%', '%%', get_background_image() ) ) ) ); - // background-image URL must be single quote, see below - $background_styles .= ' background-image: url(\'' . $background_image_thumb . '\');' - . ' background-repeat: ' . get_theme_mod( 'background_repeat', get_theme_support( 'custom-background', 'default-repeat' ) ) . ';' - . ' background-position: top ' . get_theme_mod( 'background_position_x', get_theme_support( 'custom-background', 'default-position-x' ) ); -} -?> -
- -
- - -
- + if ( get_background_image() ) { + $background_image_thumb = esc_url( set_url_scheme( get_theme_mod( 'background_image_thumb', str_replace( '%', '%%', get_background_image() ) ) ) ); + // background-image URL must be single quote, see below + $background_styles .= ' background-image: url(\'' . $background_image_thumb . '\');' + . ' background-repeat: ' . get_theme_mod( 'background_repeat', get_theme_support( 'custom-background', 'default-repeat' ) ) . ';' + . ' background-position: top ' . get_theme_mod( 'background_position_x', get_theme_support( 'custom-background', 'default-position-x' ) ); + } + ?> +
+ +
+ + +
+
diff --git a/wp-admin/custom-header.php b/wp-admin/custom-header.php index 63a2e3313e..8009bc3c2f 100644 --- a/wp-admin/custom-header.php +++ b/wp-admin/custom-header.php @@ -450,7 +450,7 @@ class Custom_Image_Header { ?>
-

+

updated ) ) { ?>
@@ -467,8 +467,9 @@ class Custom_Image_Header {
- admin_image_div_callback ) { - call_user_func( $this->admin_image_div_callback ); + 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() ) . ');';