X-Git-Url: https://scripts.mit.edu/gitweb/autoinstalls/wordpress.git/blobdiff_plain/fef8173b8c3bad08f495551e43cfdeac1cae6021..80e421fa26a0ef412d7c67749a64a6c1919d515a:/wp-includes/widgets.php diff --git a/wp-includes/widgets.php b/wp-includes/widgets.php index 4c6d4f44..2277fad1 100644 --- a/wp-includes/widgets.php +++ b/wp-includes/widgets.php @@ -74,7 +74,7 @@ class WP_Widget { * PHP4 constructor */ function WP_Widget( $id_base = false, $name, $widget_options = array(), $control_options = array() ) { - $this->__construct( $id_base, $name, $widget_options, $control_options ); + WP_Widget::__construct( $id_base, $name, $widget_options, $control_options ); } /** @@ -139,7 +139,7 @@ class WP_Widget { } if ( $empty ) { - // If there are none, we register the widget's existance with a + // If there are none, we register the widget's existence with a // generic template $this->_set(1); $this->_register_one(); @@ -152,15 +152,15 @@ class WP_Widget { } function _get_display_callback() { - return array(&$this, 'display_callback'); + return array($this, 'display_callback'); } function _get_update_callback() { - return array(&$this, 'update_callback'); + return array($this, 'update_callback'); } function _get_form_callback() { - return array(&$this, 'form_callback'); + return array($this, 'form_callback'); } /** Generate the actual widget content. @@ -296,8 +296,8 @@ class WP_Widget { if ( !is_array($settings) ) $settings = array(); - if ( !array_key_exists('_multiwidget', $settings) ) { - // old format, conver if single widget + if ( !empty($settings) && !array_key_exists('_multiwidget', $settings) ) { + // old format, convert if single widget $settings = wp_convert_widget_settings($this->id_base, $this->option_name, $settings); } @@ -317,11 +317,11 @@ class WP_Widget_Factory { var $widgets = array(); function WP_Widget_Factory() { - add_action( 'widgets_init', array( &$this, '_register_widgets' ), 100 ); + add_action( 'widgets_init', array( $this, '_register_widgets' ), 100 ); } function register($widget_class) { - $this->widgets[$widget_class] = & new $widget_class(); + $this->widgets[$widget_class] = new $widget_class(); } function unregister($widget_class) { @@ -385,7 +385,7 @@ $_wp_sidebars_widgets = array(); /** * Private */ - $_wp_deprecated_widgets_callbacks = array( + $GLOBALS['_wp_deprecated_widgets_callbacks'] = array( 'wp_widget_pages', 'wp_widget_pages_control', 'wp_widget_calendar', @@ -461,7 +461,7 @@ function unregister_widget($widget_class) { * The default for the name is "Sidebar #", with '#' being replaced with the * number the sidebar is currently when greater than one. If first sidebar, the * name will be just "Sidebar". The default for id is "sidebar-" followed by the - * number the sidebar creation is currently at. If the id is provided, and mutliple + * number the sidebar creation is currently at. If the id is provided, and multiple * sidebars are being defined, the id will have "-2" appended, and so on. * * @since 2.2.0 @@ -547,6 +547,7 @@ function register_sidebar($args = array()) { 'name' => sprintf(__('Sidebar %d'), $i ), 'id' => "sidebar-$i", 'description' => '', + 'class' => '', 'before_widget' => '