From 2719acb8edcd6ea658173bdc0a412c3562a57ae8 Mon Sep 17 00:00:00 2001 From: Ryan Boren Date: Mon, 5 Jan 2009 23:03:17 +0000 Subject: [PATCH] Default to empty array if sidebars_widgets is not set. Don't unset array_version if not set. fixes #8804 for trunk git-svn-id: https://develop.svn.wordpress.org/trunk@10314 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-includes/widgets.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/wp-includes/widgets.php b/wp-includes/widgets.php index 0224da70b9..2d65401833 100644 --- a/wp-includes/widgets.php +++ b/wp-includes/widgets.php @@ -548,7 +548,7 @@ function is_dynamic_sidebar() { function wp_get_sidebars_widgets($update = true) { global $wp_registered_widgets, $wp_registered_sidebars; - $sidebars_widgets = get_option('sidebars_widgets'); + $sidebars_widgets = get_option('sidebars_widgets', array()); $_sidebars_widgets = array(); if ( !isset($sidebars_widgets['array_version']) ) @@ -618,7 +618,8 @@ function wp_get_sidebars_widgets($update = true) { update_option('sidebars_widgets', $sidebars_widgets); } - unset($sidebars_widgets['array_version']); + if ( isset($sidebars_widgets['array_version']) ) + unset($sidebars_widgets['array_version']); $sidebars_widgets = apply_filters('sidebars_widgets', $sidebars_widgets); return $sidebars_widgets;