I'm building a custom Wordpress theme and I'm trying to add the ability to use a custom background through the admin panel. I used the example given here in the WP codex. I'm using WordPress 3.5.2
I am getting the background option and it all appears to work fine until I actual view the page. I have noticed that it adds an internal style which refers to a body with class name "custom-background" but the body's actual class is "customize-support". When I adjust these using Chrome's debug it applies the correct styling so is it a bug in a Wordpress function somewhere? I've tried to find where it would give the body that class but can't find anything.
functions.php from theme
<?php
/*
* Adds the custom header option to the theme
*/
function addthemeoptions(){
//Default values of the header image
$header_defaults = array(
'default-image' => '%s/images/header.png',
'random-default' => false,
'flex-height' => false,
'flex-width' => false,
'default-text-color' => '',
'header-text' => false,
'uploads' => true,
'wp-head-callback' => '',
'admin-head-callback' => '',
'admin-preview-callback' => '',
);
//Adds the support to use custom header images
add_theme_support( 'custom-header', $header_defaults );
$background_defaults = array(
'default-color' => '#000000',
'default-image' => '',
'wp-head-callback' => '_custom_background_cb',
'admin-head-callback' => '',
'admin-preview-callback' => ''
);
add_theme_support( 'custom-background', $background_defaults );
}
//Execute our custom theme functionality
add_action( 'after_setup_theme', 'addthemeoptions' );
?>
generated style in head
<style type="text/css" id="custom-background-css">
body.custom-background { background-color: #0a0a0a; }
</style>
body tag from debug
<body class=" customize-support" style>
Thanks in advance
Edit: I've found a temporary fix to just add the correct class value into my header.php where body tag is opened but I feel there should be a more complete solution as I'm hard-correcting something that should be generated correctly by a function in WordPress?