[wp-trac] [WordPress Trac] #28687: Removing background image and/or reverting background color to default doesn't remove custom-background body class and remove theme mods

WordPress Trac noreply at wordpress.org
Mon Jun 30 07:54:36 UTC 2014


#28687: Removing background image and/or reverting background color to default
doesn't remove custom-background body class and remove theme mods
---------------------------+------------------------------
 Reporter:  slobodanmanic  |       Owner:
     Type:  defect (bug)   |      Status:  new
 Priority:  normal         |   Milestone:  Awaiting Review
Component:  Themes         |     Version:  trunk
 Severity:  normal         |  Resolution:
 Keywords:                 |     Focuses:
---------------------------+------------------------------

Comment (by slobodanmanic):

 28687-2.diff checks if background color theme mod value is the same as
 theme default and if yes, doesn't add {{{.custom-background}}} to body
 classes.

 Another problem remains, it's related, but not the same, and it has to do
 with all background related theme mods being kept in the database.

 With background image:

 * when you remove it, it sets {{{background_image}}} theme mod to empty
 string, to make sure missing fallback to theme default image doesn't
 happen
 * when you reset it, theme mod is deleted and fallback to theme default
 happen


 Color should work the same way, resetting to default should delete
 {{{background_color}}} theme mod, so it can fallback to theme default
 background color. 28687.diff does this.

 Posted as two separate patches because these are two different, although
 closely related problems. I can post unified patch if that makes more
 sense.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/28687#comment:1>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list