Make WordPress Core

Changeset 42048


Ignore:
Timestamp:
10/31/2017 02:58:42 AM (6 years ago)
Author:
westonruter
Message:

Customize: Consolidate sourcing of control params.

Prevent needlessly iterating over controlConstructor to find type when it is already supplied.

Amends [41750], [41726].
See #42083.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/js/customize-controls.js

    r42046 r42048  
    34673467            var control = this, deferredSettingIds = [], settings, gatherSettings;
    34683468
    3469             control.params = _.extend( {}, control.defaults );
     3469            control.params = _.extend(
     3470                {},
     3471                control.defaults,
     3472                control.params || {}, // In case sub-class already defines.
     3473                options.params || options || {} // The options.params property is deprecated, but it is checked first for back-compat.
     3474            );
    34703475
    34713476            if ( ! api.Control.instanceCounter ) {
     
    34883493            }
    34893494
    3490             _.extend( control.params, options.params || options );
    34913495            if ( ! control.params.content ) {
    34923496                control.params.content = $( '<li></li>', {
Note: See TracChangeset for help on using the changeset viewer.