[wp-trac] [WordPress Trac] #27767: Customizer: Widget settings are lost when activating a previewed theme

WordPress Trac noreply at wordpress.org
Sat Apr 12 05:41:10 UTC 2014


#27767: Customizer: Widget settings are lost when activating a previewed theme
-----------------------------+--------------------
 Reporter:  ocean90          |       Owner:
     Type:  defect (bug)     |      Status:  new
 Priority:  highest omg bbq  |   Milestone:  3.9
Component:  Appearance       |     Version:  trunk
 Severity:  blocker          |  Resolution:
 Keywords:  needs-patch      |     Focuses:
-----------------------------+--------------------

Comment (by gcorne):

 Since @DH-Shredder asked me to guess at how much effort was involved, I
 started digging in a bit and came up with an idea for how to fix the
 issues. [attachment:27767-02.patch 27767-02.patch] seems to do it,
 although it definitely needs testing, review, and docs. The basic idea is:

 1. When loading the customizer with a theme that is not active, we need to
 retrieve_widgets(), but without any writes occurring, so I added another
 argument that is used to control whether writes occur. This gets tricky
 because we also need to do the same when loading the iframe the first
 time, so the patch relies on the fact that
 {{{customize_messenger_channel}}} will be {{{preview-0}}} the first time.

 2. When saving the customizer and activating a theme, we need to capture
 that the action happened via the customizer so that we don't apply
 retrieve_widgets() again. I think the ideal is for this data to be
 incorporated into the {{{theme_switched}}} option to avoid races.

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


More information about the wp-trac mailing list