[wp-testers] Error in Twenty Twelve Theme with add_custom_background

Aero Maxx aero.maxx.d at gmail.com
Wed Mar 21 20:55:38 UTC 2012


On 20/03/2012 21:09, Amy Hendrix wrote:
> On Tue, Mar 20, 2012 at 4:57 PM, Aero Maxx<aero.maxx.d at gmail.com>  wrote:
>> Hi Everyone,
>>
>> Unsure if this is the correct place, but I just downloaded the latest.zip
>> file from the wordpress site, and there seems to be an issue with the twenty
>> twelve that was in it.
>>
>> It complains about the deprecated use of add_custom_background and to use
>> add_theme_support ( 'custom-background' ); instead.
>>
>> I have editted the functions.php file to use add_theme_support (
>> 'custom-background' ); instead, but now I get a new error.
>>
>> Warning: Cannot unset offset in a non-array variable in
>> /home/daniel/public_html/development-sites/wordpress-stable.dev/web/public/wordpress/wp-includes/theme.php
>> on line 1370 Warning: Cannot use a scalar value as an array in
>> /home/daniel/public_html/development-sites/wordpress-stable.dev/web/public/wordpress/wp-includes/theme.php
>> on line 1390
>>
>> I'm not sure how to fix that I have looked in the wordpress code and seen
>> where its doing the unset.
>>
>>>         case 'custom-background' :
>>>             $defaults = array(
>>>                 'default-image' =>  '',
>>>                 'default-color' =>  '',
>>>                 'callback' =>  '',
>>>                 'admin-header-callback' =>  '',
>>>                 'admin-image-div-callback' =>  '',
>>>             );
>>>
>>>             $jit = isset( $args[0]['__jit'] );
>>>             unset( $args[0]['__jit'] );
>>
>> Thanks
>> Daniel.
>> _______________________________________________
>> wp-testers mailing list
>> wp-testers at lists.automattic.com
>> http://lists.automattic.com/mailman/listinfo/wp-testers
> _______________________________________________
> wp-testers mailing list
> wp-testers at lists.automattic.com
> http://lists.automattic.com/mailman/listinfo/wp-testers
> Twenty Twelve was removed in
> http://core.trac.wordpress.org/changeset/20219 -- it'll be back for
> 3.5, but it's gone for now.
>
> The deprecated notices you're seeing are related to
> http://core.trac.wordpress.org/ticket/20249 -- you may want to follow
> that one, as some changes are still happening there. Twenty Eleven and
> Twenty Ten are getting upgraded to the new version of custom
> headers/backgrounds, but (since it's gone) not Twenty Twelve.
Ah I see that'll explain things then as I have a cron to download it 
daily to my dev server and update all my test installs, it also 
downloads the beta one from the svn and I think things got a bit mixed 
up when I was moving my stuff over to a newer faster server on my local 
network.

Also just for future this thread is a bit of a mixture of top posting 
and bottom posting, but as its not got that many replies not too hard to 
follow, just a mention as some lists have rules/guidelines against top 
posting.


More information about the wp-testers mailing list