Customize: Consolidate sourcing of control params
.
Prevent needlessly iterating over `controlConstructor` to find `type` when it is already supplied. Amends [41750], [41726]. See #42083. git-svn-id: https://develop.svn.wordpress.org/trunk@42048 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
0a964a48f8
commit
00eb9473b2
@ -3466,7 +3466,12 @@
|
||||
initialize: function( id, options ) {
|
||||
var control = this, deferredSettingIds = [], settings, gatherSettings;
|
||||
|
||||
control.params = _.extend( {}, control.defaults );
|
||||
control.params = _.extend(
|
||||
{},
|
||||
control.defaults,
|
||||
control.params || {}, // In case sub-class already defines.
|
||||
options.params || options || {} // The options.params property is deprecated, but it is checked first for back-compat.
|
||||
);
|
||||
|
||||
if ( ! api.Control.instanceCounter ) {
|
||||
api.Control.instanceCounter = 0;
|
||||
@ -3487,7 +3492,6 @@
|
||||
} );
|
||||
}
|
||||
|
||||
_.extend( control.params, options.params || options );
|
||||
if ( ! control.params.content ) {
|
||||
control.params.content = $( '<li></li>', {
|
||||
id: 'customize-control-' + id.replace( /]/g, '' ).replace( /\[/g, '-' ),
|
||||
|
Loading…
Reference in New Issue
Block a user