Make WordPress Core

Ticket #9651: remove-pass-by-reference.diff

File remove-pass-by-reference.diff, 2.3 KB (added by jbsil, 15 years ago)

changes 3 &$this to $this in apply_filters calls

  • widgets.php

     
    167167                if ( array_key_exists( $this->number, $settings ) ) {
    168168            $settings = $settings[$this->number];
    169169                        // filters the widget's settings, return false to stop displaying the widget
    170                         $settings = apply_filters('widget_display_callback', $settings, &$this);   
     170                        $settings = apply_filters('widget_display_callback', $settings, $this);
    171171            if ( false !== $settings )
    172172                                $this->widget($args, $settings);
    173173        }
     
    228228                                                $instance = $this->update($new_instance, array());
    229229
    230230                                        // filters the widget's settings before saving, return false to cancel saving (keep the old settings if updating)
    231                                         $instance = apply_filters('widget_update_callback', $instance, $new_instance, &$this);
     231                                        $instance = apply_filters('widget_update_callback', $instance, $new_instance, $this);
    232232                                        if ( false !== $instance )
    233233                                                $all_instances[$number] = $instance;
    234234                                }
     
    258258                }
    259259
    260260                // filters the widget admin form before displaying, return false to stop displaying it
    261                 $instance = apply_filters('widget_form_callback', $instance, &$this);
     261                $instance = apply_filters('widget_form_callback', $instance, $this);
    262262                if ( false !== $instance )
    263263                        $this->form($instance);
    264264        }
     
    277277
    278278        function get_settings() {
    279279                $settings = get_option($this->option_name);
    280                
     280
    281281                if ( false === $settings && isset($this->alt_option_name) )
    282282                        $settings = get_option($this->alt_option_name);
    283283
     
    801801 * in which the first instance of the widget with the given callback or $id_base is found.
    802802 * With the $widget_id parameter, returns the ID of the sidebar where
    803803 * the widget with that callback/$id_base AND that ID is found.
    804  * 
     804 *
    805805 * NOTE: $widget_id and $id_base are the same for single widgets. To be effective
    806806 * this function has to run after widgets have initialized, at action 'init' or later.
    807807 *
     
    10211021                                $GLOBALS['_wp_sidebars_widgets'] = get_option('sidebars_widgets');
    10221022                        $sidebars_widgets = &$GLOBALS['_wp_sidebars_widgets'];
    10231023                }
    1024                
     1024
    10251025                foreach ( (array) $sidebars_widgets as $index => $sidebar ) {
    10261026                        if ( is_array($sidebar) ) {
    10271027                                foreach ( $sidebar as $i => $name ) {