diff --git a/wp-admin/css/wp-admin.dev.css b/wp-admin/css/wp-admin.dev.css index 772b2fa64..5cb14150a 100644 --- a/wp-admin/css/wp-admin.dev.css +++ b/wp-admin/css/wp-admin.dev.css @@ -3659,6 +3659,11 @@ div#custom-background h2 { width:80px; } +#custom-background-image { + max-width: 400px; + max-height: 200px; +} + div#custom-background-image img { max-width: 400px; max-height: 200px; diff --git a/wp-admin/custom-background.php b/wp-admin/custom-background.php index 22ecc7995..e6f91ce23 100644 --- a/wp-admin/custom-background.php +++ b/wp-admin/custom-background.php @@ -227,15 +227,21 @@ class Custom_Background {

- -

+ +

admin_image_div_callback ) { call_user_func($this->admin_image_div_callback); } else { + if ( $bgcolor = get_background_color() ) + $bgcolor = ' style="background-color: #' . $bgcolor . ';"'; + else + $bgcolor = ''; ?> -
+
> + +
diff --git a/wp-includes/theme.php b/wp-includes/theme.php index 033a4df9b..80e3cfdd0 100644 --- a/wp-includes/theme.php +++ b/wp-includes/theme.php @@ -1436,8 +1436,8 @@ function add_custom_background($header_callback = '', $admin_header_callback = ' */ function _custom_background_cb() { $background = get_background_image(); - - if ( !$background ) + $color = get_background_color(); + if ( !$background && !$color ) return; $repeat = get_theme_mod('background_repeat', 'repeat'); @@ -1457,11 +1457,26 @@ function _custom_background_cb() { $attachment = 'background-attachment: scroll;'; else $attachment = 'background-attachment: fixed;'; + + if ( !empty($background ) ) + $image = "background-image: url('$background');"; + else + $image = ''; + + if ( !empty($background ) ) + $image = "background-image: url('$background');"; + else + $image = ''; + + if ( !empty($color) ) + $color = "background-color: #$color;"; + else + $color = ''; ?>