Make WordPress Core

Changeset 22118


Ignore:
Timestamp:
10/04/2012 08:00:16 PM (14 years ago)
Author:
ryan
Message:

Objects no longer need to be explicitly passed by ref to call_user_func*() to be callable. Props wonderboymusic. fixes #21865

Location:
trunk/wp-includes
Files:
13 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/cache.php

    r22111 r22118  
    636636                 * already calls __destruct()
    637637                 */
    638                 register_shutdown_function( array( &$this, '__destruct' ) );
     638                register_shutdown_function( array( $this, '__destruct' ) );
    639639        }
    640640
  • trunk/wp-includes/capabilities.php

    r22060 r22118  
    726726                //Filter out caps that are not role names and assign to $this->roles
    727727                if ( is_array( $this->caps ) )
    728                         $this->roles = array_filter( array_keys( $this->caps ), array( &$wp_roles, 'is_role' ) );
     728                        $this->roles = array_filter( array_keys( $this->caps ), array( $wp_roles, 'is_role' ) );
    729729
    730730                //Build $allcaps from role caps, overlay user's $caps
     
    13321332        $args = array_merge( array( $capability ), $args );
    13331333
    1334         return call_user_func_array( array( &$author, 'has_cap' ), $args );
     1334        return call_user_func_array( array( $author, 'has_cap' ), $args );
    13351335}
    13361336
     
    13541354        $args = array_merge( array( $capability ), $args );
    13551355
    1356         return call_user_func_array( array( &$user, 'has_cap' ), $args );
     1356        return call_user_func_array( array( $user, 'has_cap' ), $args );
    13571357}
    13581358
  • trunk/wp-includes/class-http.php

    r22055 r22118  
    11101110
    11111111                if ( true === $r['blocking'] )
    1112                         curl_setopt( $handle, CURLOPT_HEADERFUNCTION, array( &$this, 'stream_headers' ) );
     1112                        curl_setopt( $handle, CURLOPT_HEADERFUNCTION, array( $this, 'stream_headers' ) );
    11131113
    11141114                curl_setopt( $handle, CURLOPT_HEADER, false );
  • trunk/wp-includes/class-oembed.php

    r22003 r22118  
    5454
    5555                // Fix any embeds that contain new lines in the middle of the HTML which breaks wpautop().
    56                 add_filter( 'oembed_dataparse', array(&$this, '_strip_newlines'), 10, 3 );
     56                add_filter( 'oembed_dataparse', array($this, '_strip_newlines'), 10, 3 );
    5757        }
    5858
  • trunk/wp-includes/class-wp-walker.php

    r19712 r22118  
    127127                        $args[0]['has_children'] = ! empty( $children_elements[$element->$id_field] );
    128128                $cb_args = array_merge( array(&$output, $element, $depth), $args);
    129                 call_user_func_array(array(&$this, 'start_el'), $cb_args);
     129                call_user_func_array(array($this, 'start_el'), $cb_args);
    130130
    131131                $id = $element->$id_field;
     
    140140                                        //start the child delimiter
    141141                                        $cb_args = array_merge( array(&$output, $depth), $args);
    142                                         call_user_func_array(array(&$this, 'start_lvl'), $cb_args);
     142                                        call_user_func_array(array($this, 'start_lvl'), $cb_args);
    143143                                }
    144144                                $this->display_element( $child, $children_elements, $max_depth, $depth + 1, $args, $output );
     
    150150                        //end the child delimiter
    151151                        $cb_args = array_merge( array(&$output, $depth), $args);
    152                         call_user_func_array(array(&$this, 'end_lvl'), $cb_args);
     152                        call_user_func_array(array($this, 'end_lvl'), $cb_args);
    153153                }
    154154
    155155                //end this element
    156156                $cb_args = array_merge( array(&$output, $element, $depth), $args);
    157                 call_user_func_array(array(&$this, 'end_el'), $cb_args);
     157                call_user_func_array(array($this, 'end_el'), $cb_args);
    158158        }
    159159
  • trunk/wp-includes/class-wp.php

    r21818 r22118  
    607607         */
    608608        function _map() {
    609                 $callback = array(&$this, 'callback');
     609                $callback = array($this, 'callback');
    610610                return preg_replace_callback($this->_pattern, $callback, $this->_subject);
    611611        }
  • trunk/wp-includes/default-widgets.php

    r21978 r22118  
    537537                $this->alt_option_name = 'widget_recent_entries';
    538538
    539                 add_action( 'save_post', array(&$this, 'flush_widget_cache') );
    540                 add_action( 'deleted_post', array(&$this, 'flush_widget_cache') );
    541                 add_action( 'switch_theme', array(&$this, 'flush_widget_cache') );
     539                add_action( 'save_post', array($this, 'flush_widget_cache') );
     540                add_action( 'deleted_post', array($this, 'flush_widget_cache') );
     541                add_action( 'switch_theme', array($this, 'flush_widget_cache') );
    542542        }
    543543
     
    638638
    639639                if ( is_active_widget(false, false, $this->id_base) )
    640                         add_action( 'wp_head', array(&$this, 'recent_comments_style') );
    641 
    642                 add_action( 'comment_post', array(&$this, 'flush_widget_cache') );
    643                 add_action( 'transition_comment_status', array(&$this, 'flush_widget_cache') );
     640                        add_action( 'wp_head', array($this, 'recent_comments_style') );
     641
     642                add_action( 'comment_post', array($this, 'flush_widget_cache') );
     643                add_action( 'transition_comment_status', array($this, 'flush_widget_cache') );
    644644        }
    645645
  • trunk/wp-includes/nav-menu-template.php

    r21868 r22118  
    476476        $args = array( $items, $depth, $r );
    477477
    478         return call_user_func_array( array(&$walker, 'walk'), $args );
     478        return call_user_func_array( array($walker, 'walk'), $args );
    479479}
    480480
  • trunk/wp-includes/post-template.php

    r22107 r22118  
    938938
    939939        $args = array($pages, $depth, $r, $current_page);
    940         return call_user_func_array(array(&$walker, 'walk'), $args);
     940        return call_user_func_array(array($walker, 'walk'), $args);
    941941}
    942942
     
    955955                $walker = $args[2]['walker'];
    956956
    957         return call_user_func_array(array(&$walker, 'walk'), $args);
     957        return call_user_func_array(array($walker, 'walk'), $args);
    958958}
    959959
  • trunk/wp-includes/taxonomy.php

    r22114 r22118  
    14111411                $children = _get_term_hierarchy($taxonomies[0]);
    14121412                if ( ! empty($children) )
    1413                         $terms = & _get_term_children($child_of, $terms, $taxonomies[0]);
     1413                        $terms = _get_term_children($child_of, $terms, $taxonomies[0]);
    14141414        }
    14151415
  • trunk/wp-includes/widgets.php

    r19684 r22118  
    153153
    154154        function _get_display_callback() {
    155                 return array(&$this, 'display_callback');
     155                return array($this, 'display_callback');
    156156        }
    157157
    158158        function _get_update_callback() {
    159                 return array(&$this, 'update_callback');
     159                return array($this, 'update_callback');
    160160        }
    161161
    162162        function _get_form_callback() {
    163                 return array(&$this, 'form_callback');
     163                return array($this, 'form_callback');
    164164        }
    165165
     
    318318
    319319        function WP_Widget_Factory() {
    320                 add_action( 'widgets_init', array( &$this, '_register_widgets' ), 100 );
     320                add_action( 'widgets_init', array( $this, '_register_widgets' ), 100 );
    321321        }
    322322
  • trunk/wp-includes/wp-db.php

    r21807 r22118  
    535535         */
    536536        function __construct( $dbuser, $dbpassword, $dbname, $dbhost ) {
    537                 register_shutdown_function( array( &$this, '__destruct' ) );
     537                register_shutdown_function( array( $this, '__destruct' ) );
    538538
    539539                if ( WP_DEBUG )
     
    10011001                $query = str_replace( '%f' , '%F', $query ); // Force floats to be locale unaware
    10021002                $query = preg_replace( '|(?<!%)%s|', "'%s'", $query ); // quote the strings, avoiding escaped strings like %%s
    1003                 array_walk( $args, array( &$this, 'escape_by_ref' ) );
     1003                array_walk( $args, array( $this, 'escape_by_ref' ) );
    10041004                return @vsprintf( $query, $args );
    10051005        }
  • trunk/wp-includes/wp-diff.php

    r19712 r22118  
    423423
    424424                // L1-norm of difference vector.
    425                 $difference = array_sum( array_map( array(&$this, 'difference'), $chars1, $chars2 ) );
     425                $difference = array_sum( array_map( array($this, 'difference'), $chars1, $chars2 ) );
    426426
    427427                // $string1 has zero length? Odd. Give huge penalty by not dividing.
Note: See TracChangeset for help on using the changeset viewer.