[theme-reviewers] Something we need to check for 3.4 appearance -> background
otto at ottodestruct.com
Mon Jun 11 18:49:38 UTC 2012
I think you've got this backwards, man.
Child theme's have their functions.php files executed first. So if
they call add_theme_support('custom_background,$args); with the
$args['default-image'] set, then they can easily override the default
image of the parent theme. Look at how add_theme_support handles
In other words, if child has this:
add_theme_support( 'custom_background, array( 'default-image'=>'foo' ) );
and the parent has this:
add_theme_support( 'custom_background, array( 'default-image'=>'bar' ) );
Then the default image will be "foo".
*Neither* the parent nor the child should be attempting to adjust the
background image in the style.css file at this point.
Custom-backgrounds mean that the background is chosen by the user, not
by the theme. The theme is defining defaults and letting the user
choose. Attempting to change it in the style.css file directly isn't
letting the user choose anymore.
On Mon, Jun 11, 2012 at 1:33 PM, Philip M. Hofer (Frumph)
<philip at frumph.net> wrote:
> Because of the coding of how appearance -> background works in 3.4 there is
> going to be a problem with 'parent' themes setting default images and colors
> to their theme. (probably just images from what I read)
> The problem:
> If a parent theme sets an image as a default in the $args, it will forever
> then be required to use the appearance -> background
> Order of execution, even if you remove the background image and color from
> the background -> appearance it still sets background-image: none; even
> after cleared.
> What this does?
> This makes it so that any image set from the style.css either child theme or
> parent theme or even plugin will be ignored completely.
> What we need to look for.
> If the theme in question ever wants to have child themes associated with it,
> then the main theme must *not* set defaults in the $args in 3.4
> Since we want everyone to be child theme capable. Then if any defaults are
> set in the parent theme they need to be removed or child themes simply will
> not work when setting a new image for that child theme.
> This might change if the logic changes before release, but this is how it is
> right now. according to:
> theme-reviewers mailing list
> theme-reviewers at lists.wordpress.org
More information about the theme-reviewers