Make WordPress Core

Ticket #21865: call-time-pass-by.diff

File call-time-pass-by.diff, 19.0 KB (added by wonderboymusic, 13 years ago)
  • wp-includes/post-template.php

     
    934934                $walker = $r['walker'];
    935935
    936936        $args = array($pages, $depth, $r, $current_page);
    937         return call_user_func_array(array(&$walker, 'walk'), $args);
     937        return call_user_func_array(array($walker, 'walk'), $args);
    938938}
    939939
    940940/**
     
    951951        else
    952952                $walker = $args[2]['walker'];
    953953
    954         return call_user_func_array(array(&$walker, 'walk'), $args);
     954        return call_user_func_array(array($walker, 'walk'), $args);
    955955}
    956956
    957957/**
  • wp-includes/nav-menu-template.php

     
    469469        $walker = ( empty($r->walker) ) ? new Walker_Nav_Menu : $r->walker;
    470470        $args = array( $items, $depth, $r );
    471471
    472         return call_user_func_array( array(&$walker, 'walk'), $args );
     472        return call_user_func_array( array($walker, 'walk'), $args );
    473473}
    474474
    475475/**
  • wp-includes/category.php

     
    185185 */
    186186function get_cat_name( $cat_id ) {
    187187        $cat_id = (int) $cat_id;
    188         $category = &get_category( $cat_id );
     188        $category = get_category( $cat_id );
    189189        if ( ! $category || is_wp_error( $category ) )
    190190                return '';
    191191        return $category->name;
     
    319319 */
    320320function _make_cat_compat( &$category ) {
    321321        if ( is_object( $category ) ) {
    322                 $category->cat_ID = &$category->term_id;
    323                 $category->category_count = &$category->count;
    324                 $category->category_description = &$category->description;
    325                 $category->cat_name = &$category->name;
    326                 $category->category_nicename = &$category->slug;
    327                 $category->category_parent = &$category->parent;
     322                $category->cat_ID = $category->term_id;
     323                $category->category_count = $category->count;
     324                $category->category_description = $category->description;
     325                $category->cat_name = $category->name;
     326                $category->category_nicename = $category->slug;
     327                $category->category_parent = $category->parent;
    328328        } elseif ( is_array( $category ) && isset( $category['term_id'] ) ) {
    329                 $category['cat_ID'] = &$category['term_id'];
    330                 $category['category_count'] = &$category['count'];
    331                 $category['category_description'] = &$category['description'];
    332                 $category['cat_name'] = &$category['name'];
    333                 $category['category_nicename'] = &$category['slug'];
    334                 $category['category_parent'] = &$category['parent'];
     329                $category['cat_ID'] = $category['term_id'];
     330                $category['category_count'] = $category['count'];
     331                $category['category_description'] = $category['description'];
     332                $category['cat_name'] = $category['name'];
     333                $category['category_nicename'] = $category['slug'];
     334                $category['category_parent'] = $category['parent'];
    335335        }
    336336}
  • wp-includes/taxonomy.php

     
    14081408        if ( $child_of ) {
    14091409                $children = _get_term_hierarchy($taxonomies[0]);
    14101410                if ( ! empty($children) )
    1411                         $terms = & _get_term_children($child_of, $terms, $taxonomies[0]);
     1411                        $terms = _get_term_children($child_of, $terms, $taxonomies[0]);
    14121412        }
    14131413
    14141414        // Update term counts to include children.
     
    29812981
    29822982        if ( !is_object($term) ) {
    29832983                if ( is_int($term) ) {
    2984                         $term = &get_term($term, $taxonomy);
     2984                        $term = get_term($term, $taxonomy);
    29852985                } else {
    2986                         $term = &get_term_by('slug', $term, $taxonomy);
     2986                        $term = get_term_by('slug', $term, $taxonomy);
    29872987                }
    29882988        }
    29892989
  • wp-includes/class-http.php

     
    11131113                }
    11141114
    11151115                if ( true === $r['blocking'] )
    1116                         curl_setopt( $handle, CURLOPT_HEADERFUNCTION, array( &$this, 'stream_headers' ) );
     1116                        curl_setopt( $handle, CURLOPT_HEADERFUNCTION, array( $this, 'stream_headers' ) );
    11171117
    11181118                curl_setopt( $handle, CURLOPT_HEADER, false );
    11191119
  • wp-includes/post.php

     
    36553655        update_post_cache( $pages );
    36563656
    36573657        if ( $child_of || $hierarchical )
    3658                 $pages = & get_page_children($child_of, $pages);
     3658                $pages = get_page_children($child_of, $pages);
    36593659
    36603660        if ( !empty($exclude_tree) ) {
    36613661                $exclude = (int) $exclude_tree;
  • wp-includes/default-widgets.php

     
    536536                parent::__construct('recent-posts', __('Recent Posts'), $widget_ops);
    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
    544544        function widget($args, $instance) {
     
    626626                $this->alt_option_name = 'widget_recent_comments';
    627627
    628628                if ( is_active_widget(false, false, $this->id_base) )
    629                         add_action( 'wp_head', array(&$this, 'recent_comments_style') );
     629                        add_action( 'wp_head', array($this, 'recent_comments_style') );
    630630
    631                 add_action( 'comment_post', array(&$this, 'flush_widget_cache') );
    632                 add_action( 'transition_comment_status', array(&$this, 'flush_widget_cache') );
     631                add_action( 'comment_post', array($this, 'flush_widget_cache') );
     632                add_action( 'transition_comment_status', array($this, 'flush_widget_cache') );
    633633        }
    634634
    635635        function recent_comments_style() {
  • wp-includes/wp-diff.php

     
    422422                $chars2 = count_chars($string2);
    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.
    428428                if ( !$string1 )
  • wp-includes/l10n.php

     
    6565 * @return string Translated text
    6666 */
    6767function translate( $text, $domain = 'default' ) {
    68         $translations = &get_translations_for_domain( $domain );
     68        $translations = get_translations_for_domain( $domain );
    6969        return apply_filters( 'gettext', $translations->translate( $text ), $text, $domain );
    7070}
    7171
     
    7878}
    7979
    8080function translate_with_gettext_context( $text, $context, $domain = 'default' ) {
    81         $translations = &get_translations_for_domain( $domain );
     81        $translations = get_translations_for_domain( $domain );
    8282        return apply_filters( 'gettext_with_context', $translations->translate( $text, $context ), $text, $context, $domain );
    8383}
    8484
     
    236236 * @return string Either $single or $plural translated text
    237237 */
    238238function _n( $single, $plural, $number, $domain = 'default' ) {
    239         $translations = &get_translations_for_domain( $domain );
     239        $translations = get_translations_for_domain( $domain );
    240240        $translation = $translations->translate_plural( $single, $plural, $number );
    241241        return apply_filters( 'ngettext', $translation, $single, $plural, $number, $domain );
    242242}
     
    249249 *
    250250 */
    251251function _nx($single, $plural, $number, $context, $domain = 'default') {
    252         $translations = &get_translations_for_domain( $domain );
     252        $translations = get_translations_for_domain( $domain );
    253253        $translation = $translations->translate_plural( $single, $plural, $number, $context );
    254254        return apply_filters( 'ngettext_with_context', $translation, $single, $plural, $number, $context, $domain );
    255255}
  • wp-includes/comment-template.php

     
    894894        update_comment_cache($wp_query->comments);
    895895
    896896        if ( $separate_comments ) {
    897                 $wp_query->comments_by_type = &separate_comments($comments);
     897                $wp_query->comments_by_type = separate_comments($comments);
    898898                $comments_by_type = &$wp_query->comments_by_type;
    899899        }
    900900
     
    14281428                if ( empty($comments) )
    14291429                        return;
    14301430                if ( 'all' != $r['type'] ) {
    1431                         $comments_by_type = &separate_comments($comments);
     1431                        $comments_by_type = separate_comments($comments);
    14321432                        if ( empty($comments_by_type[$r['type']]) )
    14331433                                return;
    14341434                        $_comments = $comments_by_type[$r['type']];
     
    14401440                        return;
    14411441                if ( 'all' != $r['type'] ) {
    14421442                        if ( empty($wp_query->comments_by_type) )
    1443                                 $wp_query->comments_by_type = &separate_comments($wp_query->comments);
     1443                                $wp_query->comments_by_type = separate_comments($wp_query->comments);
    14441444                        if ( empty($wp_query->comments_by_type[$r['type']]) )
    14451445                                return;
    14461446                        $_comments = $wp_query->comments_by_type[$r['type']];
  • wp-includes/media.php

     
    10541054         */
    10551055        function __construct() {
    10561056                // Hack to get the [embed] shortcode to run before wpautop()
    1057                 add_filter( 'the_content', array(&$this, 'run_shortcode'), 8 );
     1057                add_filter( 'the_content', array($this, 'run_shortcode'), 8 );
    10581058
    10591059                // Shortcode placeholder for strip_shortcodes()
    10601060                add_shortcode( 'embed', '__return_false' );
    10611061
    10621062                // Attempts to embed all URLs in a post
    10631063                if ( get_option('embed_autourls') )
    1064                         add_filter( 'the_content', array(&$this, 'autoembed'), 8 );
     1064                        add_filter( 'the_content', array($this, 'autoembed'), 8 );
    10651065
    10661066                // After a post is saved, invalidate the oEmbed cache
    1067                 add_action( 'save_post', array(&$this, 'delete_oembed_caches') );
     1067                add_action( 'save_post', array($this, 'delete_oembed_caches') );
    10681068
    10691069                // After a post is saved, cache oEmbed items via AJAX
    1070                 add_action( 'edit_form_advanced', array(&$this, 'maybe_run_ajax_cache') );
     1070                add_action( 'edit_form_advanced', array($this, 'maybe_run_ajax_cache') );
    10711071        }
    10721072
    10731073        /**
     
    10921092                $orig_shortcode_tags = $shortcode_tags;
    10931093                remove_all_shortcodes();
    10941094
    1095                 add_shortcode( 'embed', array(&$this, 'shortcode') );
     1095                add_shortcode( 'embed', array($this, 'shortcode') );
    10961096
    10971097                // Do the shortcode (only the [embed] one is registered)
    10981098                $content = do_shortcode( $content );
     
    12821282         * @return string Potentially modified $content.
    12831283         */
    12841284        function autoembed( $content ) {
    1285                 return preg_replace_callback( '|^\s*(https?://[^\s"]+)\s*$|im', array(&$this, 'autoembed_callback'), $content );
     1285                return preg_replace_callback( '|^\s*(https?://[^\s"]+)\s*$|im', array($this, 'autoembed_callback'), $content );
    12861286        }
    12871287
    12881288        /**
  • wp-includes/cache.php

     
    623623                 * @todo This should be moved to the PHP4 style constructor, PHP5
    624624                 * already calls __destruct()
    625625                 */
    626                 register_shutdown_function( array( &$this, '__destruct' ) );
     626                register_shutdown_function( array( $this, '__destruct' ) );
    627627        }
    628628
    629629        /**
  • wp-includes/link-template.php

     
    974974 * @return string
    975975 */
    976976function get_edit_comment_link( $comment_id = 0 ) {
    977         $comment = &get_comment( $comment_id );
     977        $comment = get_comment( $comment_id );
    978978
    979979        if ( !current_user_can( 'edit_comment', $comment->comment_ID ) )
    980980                return;
  • wp-includes/wp-db.php

     
    534534         * @param string $dbhost MySQL database host
    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 )
    540540                        $this->show_errors();
     
    10001000                $query = str_replace( '"%s"', '%s', $query ); // doublequote unquoting
    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        }
    10061006
  • wp-includes/class-wp-walker.php

     
    126126                if ( is_array( $args[0] ) )
    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;
    132132
     
    139139                                        $newlevel = true;
    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 );
    145145                        }
     
    149149                if ( isset($newlevel) && $newlevel ){
    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
    160160        /**
  • wp-includes/class-wp.php

     
    604604         * @return string
    605605         */
    606606        function _map() {
    607                 $callback = array(&$this, 'callback');
     607                $callback = array($this, 'callback');
    608608                return preg_replace_callback($this->_pattern, $callback, $this->_subject);
    609609        }
    610610
  • wp-includes/capabilities.php

     
    725725
    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
    731731                $this->allcaps = array();
     
    13171317        $args = array_slice( func_get_args(), 2 );
    13181318        $args = array_merge( array( $capability ), $args );
    13191319
    1320         return call_user_func_array( array( &$author, 'has_cap' ), $args );
     1320        return call_user_func_array( array( $author, 'has_cap' ), $args );
    13211321}
    13221322
    13231323/**
     
    13391339        $args = array_slice( func_get_args(), 2 );
    13401340        $args = array_merge( array( $capability ), $args );
    13411341
    1342         return call_user_func_array( array( &$user, 'has_cap' ), $args );
     1342        return call_user_func_array( array( $user, 'has_cap' ), $args );
    13431343}
    13441344
    13451345/**
  • wp-includes/class-oembed.php

     
    5151                ) );
    5252
    5353                // Fix any embeds that contain new lines in the middle of the HTML which breaks wpautop().
    54                 add_filter( 'oembed_dataparse', array(&$this, '_strip_newlines'), 10, 3 );
     54                add_filter( 'oembed_dataparse', array($this, '_strip_newlines'), 10, 3 );
    5555        }
    5656
    5757        /**
  • wp-includes/widgets.php

     
    152152        }
    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
    166166        /** Generate the actual widget content.
     
    317317        var $widgets = array();
    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
    323323        function register($widget_class) {
  • wp-includes/category-template.php

     
    4141 */
    4242function get_category_parents( $id, $link = false, $separator = '/', $nicename = false, $visited = array() ) {
    4343        $chain = '';
    44         $parent = &get_category( $id );
     44        $parent = get_category( $id );
    4545        if ( is_wp_error( $parent ) )
    4646                return $parent;
    4747
     
    135135 */
    136136function get_the_category_by_ID( $cat_ID ) {
    137137        $cat_ID = (int) $cat_ID;
    138         $category = &get_category( $cat_ID );
     138        $category = get_category( $cat_ID );
    139139        if ( is_wp_error( $category ) )
    140140                return $category;
    141141        return $category->name;
     
    735735        else
    736736                $walker = $args[2]['walker'];
    737737
    738         return call_user_func_array(array( &$walker, 'walk' ), $args );
     738        return call_user_func_array(array( $walker, 'walk' ), $args );
    739739}
    740740
    741741/**
     
    753753        else
    754754                $walker = $args[2]['walker'];
    755755
    756         return call_user_func_array(array( &$walker, 'walk' ), $args );
     756        return call_user_func_array(array( $walker, 'walk' ), $args );
    757757}
    758758
    759759/**
  • wp-admin/includes/ajax-actions.php

     
    331331                $term_id = $parent->term_id;
    332332
    333333                while ( $parent->parent ) { // get the top parent
    334                         $parent = &get_term( $parent->parent, $taxonomy->name );
     334                        $parent = get_term( $parent->parent, $taxonomy->name );
    335335                        if ( is_wp_error( $parent ) )
    336336                                break;
    337337                        $term_id = $parent->term_id;