[wp-trac] [WordPress Trac] #30936: Dynamically create WP_Customize_Settings for settings created on JS client

WordPress Trac noreply at wordpress.org
Sat Feb 7 22:52:14 UTC 2015


#30936: Dynamically create WP_Customize_Settings for settings created on JS client
-------------------------+------------------------
 Reporter:  westonruter  |       Owner:  ocean90
     Type:  enhancement  |      Status:  reviewing
 Priority:  normal       |   Milestone:  4.2
Component:  Customize    |     Version:  3.9
 Severity:  normal       |  Resolution:
 Keywords:  has-patch    |     Focuses:
-------------------------+------------------------

Comment (by westonruter):

 In [attachment:30936.6.diff], I fixed the issue that ocean90
 [https://cloudup.com/i3zJ2WEHBsx identified] where the form for a newly-
 created widget gets reverted to its default state after user input.

 The solution is to override the incoming `$_POST['customized']` for a
 newly-created widget's setting with the new `$instance` so that the
 preview filter currently in place from `WP_Customize_Setting::preview()`
 will use this value instead of the default widget instance value (an empty
 array). This uses a newly-introduced method
 `WP_Customize_Manager::set_post_value()`.

 @ocean90: thoughts?

 I also tried to preserve your changes which I applied here:
 https://github.com/xwp/wordpress-
 develop/commit/ee71fbe1ab64b0dc4768b074538c92b71033da73

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


More information about the wp-trac mailing list