From 61a5a4cca0bd190a7c666717fff5be055297477b Mon Sep 17 00:00:00 2001 From: ryan Date: Sat, 5 Jan 2008 05:20:56 +0000 Subject: [PATCH] Fix some array warnings. Props mdawaffe. see #5583 git-svn-id: http://svn.automattic.com/wordpress/trunk@6560 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/widgets.php | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/wp-includes/widgets.php b/wp-includes/widgets.php index 7e050e506..c1f6194f9 100644 --- a/wp-includes/widgets.php +++ b/wp-includes/widgets.php @@ -636,7 +636,8 @@ function wp_widget_text_control($widget_args) { } function wp_widget_text_register() { - $options = get_option('widget_text'); + if ( !$options = get_option('widget_text') ) + $options = array(); $widget_ops = array('classname' => 'widget_text', 'description' => __('Arbitrary text or HTML')); $control_ops = array('width' => 460, 'height' => 350, 'id_base' => 'text'); $name = __('Text'); @@ -792,7 +793,9 @@ function wp_widget_categories_control( $widget_args ) { } function wp_widget_categories_register() { - $options = get_option( 'widget_categories' ); + if ( !$options = get_option( 'widget_categories' ) ) + $options = array(); + if ( isset($options['title']) ) $options = wp_widget_categories_upgrade(); @@ -1157,7 +1160,8 @@ function wp_widget_rss_control($widget_args) { } function wp_widget_rss_register() { - $options = get_option('widget_rss'); + if ( !$options = get_option('widget_rss') ) + $options = array(); $widget_ops = array('classname' => 'widget_rss', 'description' => __( 'Entries from any RSS or Atom feed' )); $control_ops = array('width' => 410, 'height' => 200, 'id_base' => 'rss'); $name = __('RSS'); @@ -1347,7 +1351,9 @@ function widget_many_control( $widget_args = 1 ) { // Registers each instance of our widget on startup function widget_many_register() { - $options = get_option('widget_many'); + if ( !$options = get_option('widget_many') ) + $options = array(); + $widget_ops = array('classname' => 'widget_many', 'description' => __('Widget which allows multiple instances')); $control_ops = array('width' => 400, 'height' => 350, 'id_base' => 'many'); $name = __('Many');