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:
Dominik Schilling (ocean90) 2015-02-27 10:34:42 +00:00
parent aa2da3051a
commit 61dfcc3b4c
1 changed files with 7 additions and 7 deletions

View File

@ -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;