WordPress.org

Make WordPress Core

Opened 6 years ago

Closed 6 years ago

#30683 closed defect (bug) (fixed)

Customizer Background does not restore default image

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

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 6 years ago.
unfinished
30683.default-empty.diff (441 bytes) - added by celloexpressions 6 years ago.
Empty the setting when restoring the default.
30683.2.patch (4.1 KB) - added by ocean90 6 years ago.

Download all attachments as: .zip

Change History (12)

#1 @SergeyBiryukov
6 years ago

  • Milestone changed from Awaiting Review to 4.1

#2 @ocean90
6 years ago

  • Keywords needs-patch added
  • Priority changed from normal to high
  • Severity changed from normal to major

@ocean90
6 years ago

unfinished

@celloexpressions
6 years ago

Empty the setting when restoring the default.

#3 @celloexpressions
6 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
6 years ago

#4 @ocean90
6 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
6 years ago

  • Owner set to ocean90
  • Resolution set to fixed
  • Status changed from new to closed

In 30849:

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

see #21483.
fixes #30683 for trunk.

#6 @ocean90
6 years ago

  • Keywords commit added; needs-testing removed
  • Resolution fixed deleted
  • Status changed from closed to reopened

#7 @nacin
6 years ago

  • Keywords fixed-major added

#8 @johnbillion
6 years ago

This is a big improvement over 4.0.

#9 @johnbillion
6 years ago

  • Resolution set to fixed
  • Status changed from reopened to closed

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.