[wp-trac] [WordPress Trac] #43585: Dynamically created setting not received on previewer

WordPress Trac noreply at wordpress.org
Tue Mar 20 16:32:40 UTC 2018


#43585: Dynamically created setting not received on previewer
--------------------------+------------------------------
 Reporter:  jegbagus      |       Owner:
     Type:  defect (bug)  |      Status:  new
 Priority:  normal        |   Milestone:  Awaiting Review
Component:  Customize     |     Version:  4.9.4
 Severity:  normal        |  Resolution:
 Keywords:                |     Focuses:  javascript
--------------------------+------------------------------

Comment (by westonruter):

 Hi. You just have to send the setting to the preview after you create it.
 For example, [https://github.com/xwp/wp-customize-featured-content-
 demo/blob/921ab371edc5cdfb718c317a835355cfc5cca821/js/featured-items-
 panel.js#L296-L297 in the controls app]:

 {{{#!js
 setting.previewer.send( 'setting', [ setting.id, setting() ] );
 }}}

 It will then get created as a dirty setting in the preview here:
 https://github.com/WordPress/wordpress-
 develop/blob/0cc1c1104998bc4c0e4a4a484e6467f6b1fa0c6b/src/wp-includes/js
 /customize-preview.js#L695-L735

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


More information about the wp-trac mailing list