Make WordPress Core

Opened 12 years ago

Closed 12 years ago

#30683 closed defect (bug) (fixed)

Customizer Background does not restore default image

Reported by: dreamwhisper Owned by: ocean90
Priority: high Milestone: 4.1
Component: Customize Version: 4.1
Severity: major Keywords: has-patch commit fixed-major
Cc: Focuses:

Description

Related #21483

In 4.1RC, it appears you are not able to reselect a default image after uploading an alternate image.

//* Add support for custom background
add_theme_support( 'custom-background', array(
        'default-image' => get_stylesheet_directory_uri() . '/images/bg.png',
        'default-color' => 'eee',
) );

Steps to replicate:

  • Set a default image in the custom-background function as above
  • In the customizer, click Change Image to select a different image
  • Click Default Image to restore the original default image

The default image is restored as the thumbnail, but is not displayed as the background on the front end.

In addition, previously, you had the options to:

  • Upload an alternate image
  • Restore the default image
  • Remove the image altogether

All of these options are desirable when specifying a default.

Attachments (3)

30683.patch (2.1 KB ) - added by ocean90 12 years ago.
unfinished
30683.default-empty.diff (441 bytes ) - added by celloexpressions 12 years ago.
Empty the setting when restoring the default.
30683.2.patch (4.1 KB ) - added by ocean90 12 years ago.

Download all attachments as: .zip

Change History (12)

#1 @SergeyBiryukov
12 years ago

  • Milestone Awaiting Review4.1

#2 @ocean90
12 years ago

  • Keywords needs-patch added
  • Priority normalhigh
  • Severity normalmajor

@ocean90
12 years ago

unfinished

@celloexpressions
12 years ago

Empty the setting when restoring the default.

#3 @celloexpressions
12 years ago

My patch may work, but totally untested, and there's a lot of inconsistency across themes here. I had a lot of trouble with this in the original patch, and I probably shouldn't look any more deeply here again.

@ocean90
12 years ago

#4 @ocean90
12 years ago

  • Keywords has-patch needs-testing added; needs-patch removed

30683.2.patch should fix the issue. Needs some more testing.

The underlying issue is that the Customizer can't remove a setting like the Custom Header/Background screen does, see trunk/src/wp-admin/custom-background.php@30657#L174.

#5 @ocean90
12 years ago

  • Owner set to ocean90
  • Resolutionfixed
  • Status newclosed

In 30849:

Customizer: Re-add the possibility to remove and restore a default background image.

see #21483.
fixes #30683 for trunk.

#6 @ocean90
12 years ago

  • Keywords commit added; needs-testing removed
  • Resolution fixed
  • Status closedreopened

#7 @nacin
12 years ago

  • Keywords fixed-major added

#8 @johnbillion
12 years ago

This is a big improvement over 4.0.

#9 @johnbillion
12 years ago

  • Resolutionfixed
  • Status reopenedclosed

In 30911:

Customizer: Re-add the possibility to remove and restore a default background image.

Merges [30849] to the 4.1 branch.

Fixes #30683

Note: See TracTickets for help on using tickets.