From 87d69b62682e00a2e9e717dcea80d0385dae6308 Mon Sep 17 00:00:00 2001 From: ryan Date: Mon, 23 Feb 2009 06:12:53 +0000 Subject: [PATCH] Fix notice. Props ionfish. fixes #9018 git-svn-id: http://svn.automattic.com/wordpress/trunk@10631 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/widgets.php | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/wp-admin/widgets.php b/wp-admin/widgets.php index 1edc8fe2d9..fabdb5a82d 100644 --- a/wp-admin/widgets.php +++ b/wp-admin/widgets.php @@ -89,9 +89,12 @@ if ( $http_post && isset($sidebars_widgets[$_POST['sidebar']]) ) { ob_end_clean(); // Prophylactic. Take out empty ids. - foreach ( (array) $_POST['widget-id'] as $key => $val ) - if ( !$val ) - unset($_POST['widget-id'][$key]); + if ( isset($_POST['widget-id']) ) { + foreach ( (array) $_POST['widget-id'] as $key => $val ) { + if ( !$val ) + unset($_POST['widget-id'][$key]); + } + } // Reset the key numbering and store $new_sidebar = isset( $_POST['widget-id'] ) && is_array( $_POST['widget-id'] ) ? array_values( $_POST['widget-id'] ) : array();