Changeset 42024
- Timestamp:
- 10/25/2017 04:48:19 PM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/js/customize-controls.js
r41997 r42024 3475 3475 _.extend( settings, control.params.settings ); 3476 3476 3477 // Note: Settings can be an array or an object. 3478 _.each( settings, function( setting, key ) { 3479 if ( _.isObject( setting ) ) { // @todo Or check if instance of api.Setting? 3480 control.settings[ key ] = setting; 3481 } else { 3482 deferredSettingIds.push( setting ); 3477 // Note: Settings can be an array or an object, with values being either setting IDs or Setting (or Value) objects. 3478 _.each( settings, function( value, key ) { 3479 var setting; 3480 if ( _.isObject( value ) && _.isFunction( value.extended ) && value.extended( api.Value ) ) { 3481 control.settings[ key ] = value; 3482 } else if ( _.isString( value ) ) { 3483 setting = api( value ); 3484 if ( setting ) { 3485 control.settings[ key ] = setting; 3486 } else { 3487 deferredSettingIds.push( value ); 3488 } 3483 3489 } 3484 3490 } ); … … 3501 3507 control.setting = control.settings['default'] || null; 3502 3508 3509 control.linkElements(); // Link initial elements present in server-rendered content. 3503 3510 control.embed(); 3504 3511 }; … … 3512 3519 // After the control is embedded on the page, invoke the "ready" method. 3513 3520 control.deferred.embedded.done( function () { 3514 control.linkElements(); 3521 control.linkElements(); // Link any additional elements after template is rendered by renderContent(). 3515 3522 control.setupNotifications(); 3516 3523 control.ready();
Note: See TracChangeset
for help on using the changeset viewer.