[wp-trac] [WordPress Trac] #35926: Allow controls to be registered without any associated settings

WordPress Trac noreply at wordpress.org
Mon Mar 7 22:46:12 UTC 2016


#35926: Allow controls to be registered without any associated settings
---------------------------------------------+--------------------------
 Reporter:  westonruter                      |       Owner:  westonruter
     Type:  defect (bug)                     |      Status:  reopened
 Priority:  normal                           |   Milestone:  4.5
Component:  Customize                        |     Version:  3.4
 Severity:  normal                           |  Resolution:
 Keywords:  has-patch has-unit-tests commit  |     Focuses:
---------------------------------------------+--------------------------
Changes (by dlh):

 * status:  closed => reopened
 * resolution:  fixed =>


Comment:

 After [36689], when creating a control in JS, the control's `setting`
 property can't be assigned a setting instance directly in the options
 object.

 That said, I'm not sure whether passing a `setting` was "doing it wrong"
 to begin with. In my case, I was doing so only as a convenience in a unit
 test.

 For example:

 {{{
 var setting = wp.customize.create( 'foo', 'foo', 'bar', {
     transport: 'refresh',
     previewer: wp.customize.previewer,
 });

 var control = wp.customize.control.create( 'baz', 'baz', {
     setting: setting,
 });
 }}}

 `console.log( control.setting )` shows the setting instance before [36689]
 and `null` currently.

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


More information about the wp-trac mailing list