[wp-trac] [WordPress Trac] #36167: Improve alignment between settings params between Customizer Controls and Partials

WordPress Trac noreply at wordpress.org
Tue Mar 8 06:41:26 UTC 2016


#36167: Improve alignment between settings params between Customizer Controls and
Partials
-------------------------+-----------------------------
 Reporter:  westonruter  |      Owner:
     Type:  enhancement  |     Status:  new
 Priority:  low          |  Milestone:  Awaiting Review
Component:  Customize    |    Version:  trunk
 Severity:  normal       |   Keywords:
  Focuses:               |
-------------------------+-----------------------------
 In #27355, the concept of a `Partial` was introduced and is analogous to a
 `Control` in many ways, particularly in that it an object associated with
 one or more settings. A control is instantiated in JS like:

 {{{#!js
 var control = new wp.customize.Control( 'foo', {
     params: {
         setting: 'default',
         settings: { 'default': 'foo', 'bar': 'bar' },
     }
 });
 }}}

 Whereas a partial is instantiated like:

 {{{#!js
 var control = new wp.customize.Partial( 'foo', {
     params: {
         settings: [ 'foo', 'bar' ],
         primarySetting: 'foo'
     }
 });
 }}}

 Note the difference in how a partial uses `primarySetting` to designate
 the main setting for a control, whereas a control has a secondary “setting
 key” which is used identify which of the settings in the object passed
 should be the main setting.

 Personally, the way `settings` are passed to Controls is not very
 intuitive to me, but to improve the parity in the API, perhaps both styles
 should be accepted by the partial.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/36167>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list