Hi,
Building a child theme based on Twenty Ten where I do not want Custom Backgrounds, I use the following code in the child themes functions.php to remove the enabled custom background:
/** Tell WordPress to run childtheme_setup() after twentyten_setup() is run. */
add_action( 'after_setup_theme', 'childtheme_setup', 11 );
function childtheme_setup() {
... [SNIP] ...
// no custom background on this theme
remove_custom_background();
}
However, the custom background admin page still shows :(
I tried to see what remove_custom_background() returns with the code:
// no custom background on this theme
$cb_removed = remove_custom_background();
error_log( 'Custom background removed: ' . $cb_removed );
This results in Custom background removed: 1 in the error.log file which (I suppose) means the function returns TRUE like it is supposed to...
For the life of me, I cannot figure out why it won't remove the admin page.
Another thing I noticed (off-topic but related) is that when a background image is uploaded, the file will not be removed again after hitting the 'Remove background' button. The file remains in the upload directory. This happens each time with uploaded backgrounds, littering the hosting space with redundant files.