Widget Customizer: Fix incorrect replacement in [27995].

props westonruter.
fixes #27690.

Built from https://develop.svn.wordpress.org/trunk@28034


git-svn-id: http://core.svn.wordpress.org/trunk@27864 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Andrew Nacin 2014-04-08 04:03:14 +00:00
parent 658032c9f9
commit 5ea061ef8d
2 changed files with 4 additions and 4 deletions

View File

@ -1380,7 +1380,7 @@
// Check if the widget is in another sidebar // Check if the widget is in another sidebar
api.each( function( otherSetting ) { api.each( function( otherSetting ) {
if ( otherSetting.id === self.setting.id || 0 !== otherSetting.id.indexOf( 'sidebars_widgets[' ) || otherSetting.id === 'sidebars_widgets[wp_inactiveWidgets]' ) { if ( otherSetting.id === self.setting.id || 0 !== otherSetting.id.indexOf( 'sidebars_widgets[' ) || otherSetting.id === 'sidebars_widgets[wp_inactive_widgets]' ) {
return; return;
} }
@ -1411,9 +1411,9 @@
// Move widget to inactive widgets sidebar (move it to trash) if has been previously saved // Move widget to inactive widgets sidebar (move it to trash) if has been previously saved
// This prevents the inactive widgets sidebar from overflowing with throwaway widgets // This prevents the inactive widgets sidebar from overflowing with throwaway widgets
if ( api.Widgets.savedWidgetIds[removedWidgetId] ) { if ( api.Widgets.savedWidgetIds[removedWidgetId] ) {
inactiveWidgets = api.value( 'sidebars_widgets[wp_inactiveWidgets]' )().slice(); inactiveWidgets = api.value( 'sidebars_widgets[wp_inactive_widgets]' )().slice();
inactiveWidgets.push( removedWidgetId ); inactiveWidgets.push( removedWidgetId );
api.value( 'sidebars_widgets[wp_inactiveWidgets]' )( _( inactiveWidgets ).unique() ); api.value( 'sidebars_widgets[wp_inactive_widgets]' )( _( inactiveWidgets ).unique() );
} }
// Make old single widget available for adding again // Make old single widget available for adding again

File diff suppressed because one or more lines are too long