From f35b2128ae34aa41449cf50eac8f9479cde49203 Mon Sep 17 00:00:00 2001 From: ryan Date: Thu, 18 Feb 2010 03:12:05 +0000 Subject: [PATCH] Add defaults for background option radios. see #12186 git-svn-id: http://svn.automattic.com/wordpress/trunk@13189 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/custom-background.php | 14 +++++++------- wp-includes/theme.php | 9 ++++++--- 2 files changed, 13 insertions(+), 10 deletions(-) diff --git a/wp-admin/custom-background.php b/wp-admin/custom-background.php index d024c9a4aa..ea54cbc27f 100644 --- a/wp-admin/custom-background.php +++ b/wp-admin/custom-background.php @@ -172,37 +172,37 @@ if ( $this->admin_image_div_callback ) {
diff --git a/wp-includes/theme.php b/wp-includes/theme.php index 0dfca9f1c8..f06e09e91a 100644 --- a/wp-includes/theme.php +++ b/wp-includes/theme.php @@ -1372,6 +1372,9 @@ function background_image() { * @param callback $admin_image_div_callback Output a custom background image div on the custom background administration screen. Optional. */ function add_custom_background($header_callback = '', $admin_header_callback = '', $admin_image_div_callback = '') { + if ( isset($GLOBALS['custom_background']) ) + return; + if ( empty($header_callback) ) $header_callback = '_custom_background_cb'; @@ -1397,19 +1400,19 @@ function _custom_background_cb() { if ( !$background ) return; - $repeat = get_theme_mod('background_repeat'); + $repeat = get_theme_mod('background_repeat', 'repeat'); if ( 'no-repeat' == $repeat ) $repeat = 'background-repeat: no-repeat;'; else $repeat = 'background-repeat: repeat;'; - $position = get_theme_mod('background_position'); + $position = get_theme_mod('background_position', 'left'); if ( 'center' == $position ) $position = 'background-position-x: center;'; elseif ( 'right' == $position ) $position = 'background-position-x: right;'; else $position = 'background-position-x: left;'; - $attachment = get_theme_mod('background_attachment'); + $attachment = get_theme_mod('background_attachment', 'fixed'); if ( 'scroll' == $attachment ) $attachment = 'background-attachment: scroll;'; else