Make WordPress Core

Ticket #5583: 5583b.diff

File 5583b.diff, 1.6 KB (added by mdawaffe, 17 years ago)

fix array marnings

  • wp-includes/widgets.php

     
    636636}
    637637
    638638function wp_widget_text_register() {
    639         $options = get_option('widget_text');
     639        if ( !$options = get_option('widget_text') )
     640                $options = array();
    640641        $widget_ops = array('classname' => 'widget_text', 'description' => __('Arbitrary text or HTML'));
    641642        $control_ops = array('width' => 460, 'height' => 350, 'id_base' => 'text');
    642643        $name = __('Text');
     
    792793}
    793794
    794795function wp_widget_categories_register() {
    795         $options = get_option( 'widget_categories' );
     796        if ( !$options = get_option( 'widget_categories' ) )
     797                $options = array();
     798
    796799        if ( isset($options['title']) )
    797800                $options = wp_widget_categories_upgrade();
    798801
     
    11571160}
    11581161
    11591162function wp_widget_rss_register() {
    1160         $options = get_option('widget_rss');
     1163        if ( !$options = get_option('widget_rss') )
     1164                $options = array();
    11611165        $widget_ops = array('classname' => 'widget_rss', 'description' => __( 'Entries from any RSS or Atom feed' ));
    11621166        $control_ops = array('width' => 410, 'height' => 200, 'id_base' => 'rss');
    11631167        $name = __('RSS');
     
    13471351
    13481352// Registers each instance of our widget on startup
    13491353function widget_many_register() {
    1350         $options = get_option('widget_many');
     1354        if ( !$options = get_option('widget_many') )
     1355                $options = array();
     1356
    13511357        $widget_ops = array('classname' => 'widget_many', 'description' => __('Widget which allows multiple instances'));
    13521358        $control_ops = array('width' => 400, 'height' => 350, 'id_base' => 'many');
    13531359        $name = __('Many');