[wp-trac] [WordPress Trac] #37964: Allow customizer controls to be encapsulated by accepting pre-instantiated settings

WordPress Trac noreply at wordpress.org
Wed Oct 4 20:01:17 UTC 2017


#37964: Allow customizer controls to be encapsulated by accepting pre-instantiated
settings
-------------------------------------------------+-------------------------
 Reporter:  westonruter                          |       Owner:
     Type:  enhancement                          |  westonruter
 Priority:  high                                 |      Status:  closed
Component:  Customize                            |   Milestone:  4.9
 Severity:  normal                               |     Version:  3.4
 Keywords:  has-patch needs-unit-tests needs-    |  Resolution:  fixed
  testing                                        |     Focuses:  javascript
-------------------------------------------------+-------------------------
Changes (by westonruter):

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


Comment:

 In [changeset:"41750"]:
 {{{
 #!CommitTicketReference repository="" revision="41750"
 Customize: Allow controls to be created with pre-instantiated `Setting`
 object(s), or even with plain `Value` object(s).

 * Allow passing settings in keyed object (e.g. `settings: { default: 'id'
 }  ), or as an array (e.g. `settings: [ 'id' ]`) with first being default;
 again, `Setting`/`Value` objects may be supplied instead of IDs.
 * Allow a single setting to be supplied with just a single `setting`
 param, either a string or a `Setting`/`Value` object.
 * Update `changeset_status` and `scheduled_changeset_date` to be added
 dynamically with JS and simply passing of `api.state()` instances as
 `setting`.
 * Introduce a `data-customize-setting-key-link` attribute which, unlike
 `data-customize-setting-link`, allows passing the setting key (e.g.
 `default`) as opposed to the setting ID.
 * Allow `WP_Customize_Control::get_link()` to return `data-customize-
 setting-key-link` when setting is not registered.
 * Eliminate `default_value` from `WP_Customize_Date_Time_Control` since
 now comes from supplied `Value`.
 * Export status choices as
 `wp.customize.settings.changeset.statusChoices`.
 * Export date and time formats as `wp.customize.settings.dateFormat` and
 `wp.customize.settings.timeFormat` respectively.

 Props westonruter, sayedwp.
 See #39896, #30738, #30741, #42083.
 Fixes #37964, #36167.
 }}}

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


More information about the wp-trac mailing list