Customize Widgets: Don't return undefined items in getWidgetFormControls method.
props westonruter. fixes #31465. git-svn-id: https://develop.svn.wordpress.org/trunk@31570 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
aa2da3051a
commit
61dfcc3b4c
|
@ -1709,20 +1709,20 @@
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* Get the widget_form Customize controls associated with the current sidebar.
|
||||||
|
*
|
||||||
|
* @since 3.9
|
||||||
* @return {wp.customize.controlConstructor.widget_form[]}
|
* @return {wp.customize.controlConstructor.widget_form[]}
|
||||||
*/
|
*/
|
||||||
getWidgetFormControls: function() {
|
getWidgetFormControls: function() {
|
||||||
var formControls;
|
var formControls = [];
|
||||||
|
|
||||||
formControls = _( this.setting() ).map( function( widgetId ) {
|
_( this.setting() ).each( function( widgetId ) {
|
||||||
var settingId = widgetIdToSettingId( widgetId ),
|
var settingId = widgetIdToSettingId( widgetId ),
|
||||||
formControl = api.control( settingId );
|
formControl = api.control( settingId );
|
||||||
|
if ( formControl ) {
|
||||||
if ( ! formControl ) {
|
formControls.push( formControl );
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return formControl;
|
|
||||||
} );
|
} );
|
||||||
|
|
||||||
return formControls;
|
return formControls;
|
||||||
|
|
Loading…
Reference in New Issue