WordPress.org

Make WordPress Core

Ticket #16661: 16661.2.patch

File 16661.2.patch, 8.8 KB (added by hakre, 2 years ago)

review of do_action_ref_array() calls

  • wp-admin/includes/deprecated.php

     
    502502                        $this->query_where .= " AND $wpdb->users.ID = $wpdb->usermeta.user_id AND meta_key = '{$level_key}'"; 
    503503                } 
    504504 
    505                 do_action_ref_array( 'pre_user_search', array( &$this ) ); 
     505                do_action( 'pre_user_search', $this ); 
    506506        } 
    507507 
    508508        /** 
  • wp-admin/includes/user.php

     
    176176        } 
    177177 
    178178        // Allow plugins to return their own errors. 
    179         do_action_ref_array('user_profile_update_errors', array ( &$errors, $update, &$user ) ); 
     179        do_action('user_profile_update_errors', $errors, $update, $user ); 
    180180 
    181181        if ( $errors->get_error_codes() ) 
    182182                return $errors; 
  • wp-includes/admin-bar.php

     
    5757 
    5858        $wp_admin_bar->load_user_locale_translations(); 
    5959 
    60         do_action_ref_array( 'admin_bar_menu', array( &$wp_admin_bar ) ); 
     60        do_action( 'admin_bar_menu', $wp_admin_bar ); 
    6161 
    6262        do_action( 'wp_before_admin_bar_render' ); 
    6363 
  • wp-includes/class-wp.php

     
    298298 
    299299                $this->query_vars = apply_filters('request', $this->query_vars); 
    300300 
    301                 do_action_ref_array('parse_request', array(&$this)); 
     301                do_action( 'parse_request', $this ); 
    302302        } 
    303303 
    304304        /** 
     
    373373                if ( $exit_required ) 
    374374                        exit(); 
    375375 
    376                 do_action_ref_array('send_headers', array(&$this)); 
     376                do_action( 'send_headers', $this ); 
    377377        } 
    378378 
    379379        /** 
     
    501501                $this->query_posts(); 
    502502                $this->handle_404(); 
    503503                $this->register_globals(); 
    504                 do_action_ref_array('wp', array(&$this)); 
     504                do_action( 'wp', $this ); 
    505505        } 
    506506 
    507507        /** 
  • wp-includes/class.wp-scripts.php

     
    3131        var $default_dirs; 
    3232 
    3333        function __construct() { 
    34                 do_action_ref_array( 'wp_default_scripts', array(&$this) ); 
     34                do_action( 'wp_default_scripts', $this ); 
    3535        } 
    3636 
    3737        /** 
  • wp-includes/class.wp-styles.php

     
    2828        var $default_dirs; 
    2929 
    3030        function __construct() { 
    31                 do_action_ref_array( 'wp_default_styles', array(&$this) ); 
     31                do_action( 'wp_default_styles', $this ); 
    3232        } 
    3333 
    3434        function do_item( $handle ) { 
  • wp-includes/comment.php

     
    221221                ); 
    222222 
    223223                $this->query_vars = wp_parse_args( $query_vars, $defaults ); 
    224                 do_action_ref_array( 'pre_get_comments', array( &$this ) ); 
     224                do_action( 'pre_get_comments', $this ); 
    225225                extract( $this->query_vars, EXTR_SKIP ); 
    226226 
    227227                // $args can be whatever, only use the args defined in defaults to compute the key 
  • wp-includes/feed.php

     
    535535        $feed->set_cache_class('WP_Feed_Cache'); 
    536536        $feed->set_file_class('WP_SimplePie_File'); 
    537537        $feed->set_cache_duration(apply_filters('wp_feed_cache_transient_lifetime', 43200, $url)); 
    538         do_action_ref_array( 'wp_feed_options', array( &$feed, $url ) ); 
     538        do_action( 'wp_feed_options', $feed, $url ); 
    539539        $feed->init(); 
    540540        $feed->handle_content_type(); 
    541541 
  • wp-includes/pluggable.php

     
    256256 * @uses apply_filters() Calls 'wp_mail_from_name' hook to get the from address name. 
    257257 * @uses apply_filters() Calls 'wp_mail_content_type' hook to get the email content type. 
    258258 * @uses apply_filters() Calls 'wp_mail_charset' hook to get the email charset 
    259  * @uses do_action_ref_array() Calls 'phpmailer_init' hook on the reference to 
     259 * @uses do_action() Calls 'phpmailer_init' hook on the reference to 
    260260 *              phpmailer object. 
    261261 * @uses PHPMailer 
    262262 * @ 
     
    459459                } 
    460460        } 
    461461 
    462         do_action_ref_array( 'phpmailer_init', array( &$phpmailer ) ); 
     462        do_action( 'phpmailer_init', $phpmailer ); 
    463463 
    464464        // Send! 
    465465        $result = @$phpmailer->Send(); 
  • wp-includes/query.php

     
    16271627                if ( '404' == $qv['error'] ) 
    16281628                        $this->set_404(); 
    16291629 
    1630                 do_action_ref_array('parse_query', array(&$this)); 
     1630                do_action( 'parse_query', $this ); 
    16311631        } 
    16321632 
    16331633        /* 
     
    18681868         * 
    18691869         * @since 1.5.0 
    18701870         * @access public 
    1871          * @uses do_action_ref_array() Calls 'pre_get_posts' hook before retrieving posts. 
     1871         * @uses do_action() Calls 'pre_get_posts' hook before retrieving posts. 
    18721872         * 
    18731873         * @return array List of posts. 
    18741874         */ 
     
    18771877 
    18781878                $this->parse_query(); 
    18791879 
    1880                 do_action_ref_array('pre_get_posts', array(&$this)); 
     1880                do_action( 'pre_get_posts', $this ); 
    18811881 
    18821882                // Shorthand. 
    18831883                $q = &$this->query_vars; 
     
    27322732         * @since 1.5.0 
    27332733         * @access public 
    27342734         * @uses $post 
    2735          * @uses do_action_ref_array() Calls 'loop_start' if loop has just started 
     2735         * @uses do_action() Calls 'loop_start' if loop has just started 
    27362736         */ 
    27372737        function the_post() { 
    27382738                global $post; 
    27392739                $this->in_the_loop = true; 
    27402740 
    27412741                if ( $this->current_post == -1 ) // loop has just started 
    2742                         do_action_ref_array('loop_start', array(&$this)); 
     2742                        do_action( 'loop_start', $this ); 
    27432743 
    27442744                $post = $this->next_post(); 
    27452745                setup_postdata($post); 
     
    27522752         * 
    27532753         * @since 1.5.0 
    27542754         * @access public 
    2755          * @uses do_action_ref_array() Calls 'loop_end' if loop is ended 
     2755         * @uses do_action() Calls 'loop_end' if loop is ended 
    27562756         * 
    27572757         * @return bool True if posts are available, false if end of loop. 
    27582758         */ 
     
    27602760                if ( $this->current_post + 1 < $this->post_count ) { 
    27612761                        return true; 
    27622762                } elseif ( $this->current_post + 1 == $this->post_count && $this->post_count > 0 ) { 
    2763                         do_action_ref_array('loop_end', array(&$this)); 
     2763                        do_action( 'loop_end', $this ); 
    27642764                        // Do some cleaning up after the loop 
    27652765                        $this->rewind_posts(); 
    27662766                } 
     
    34853485 * @since 1.5.0 
    34863486 * 
    34873487 * @param object $post Post data. 
    3488  * @uses do_action_ref_array() Calls 'the_post' 
     3488 * @uses do_action() Calls 'the_post' 
    34893489 * @return bool True when finished. 
    34903490 */ 
    34913491function setup_postdata($post) { 
     
    35183518                $multipage = 0; 
    35193519        } 
    35203520 
    3521         do_action_ref_array('the_post', array(&$post)); 
     3521        do_action( 'the_post', $post ); 
    35223522 
    35233523        return true; 
    35243524} 
  • wp-includes/rewrite.php

     
    15621562                else 
    15631563                        $this->rules = array_merge($this->extra_rules_top, $robots_rewrite, $default_feeds, $registration_pages, $root_rewrite, $comments_rewrite, $search_rewrite,  $author_rewrite, $date_rewrite, $post_rewrite, $page_rewrite, $this->extra_rules); 
    15641564 
    1565                 do_action_ref_array('generate_rewrite_rules', array(&$this)); 
     1565                do_action( 'generate_rewrite_rules', $this ); 
    15661566                $this->rules = apply_filters('rewrite_rules_array', $this->rules); 
    15671567 
    15681568                return $this->rules; 
  • wp-includes/user.php

     
    531531                        $this->query_where .= " AND $wpdb->users.ID NOT IN ($ids)"; 
    532532                } 
    533533 
    534                 do_action_ref_array( 'pre_user_query', array( &$this ) ); 
     534                do_action( 'pre_user_query', $this ); 
    535535        } 
    536536 
    537537        /** 
  • wp-includes/widgets.php

     
    270270                        $return = $this->form($instance); 
    271271                        // add extra fields in the widget form - be sure to set $return to null if you add any 
    272272                        // if the widget has no form the text echoed from the default form method can be hidden using css 
    273                         do_action_ref_array( 'in_widget_form', array(&$this, &$return, $instance) ); 
     273                        do_action_ref_array( 'in_widget_form', array($this, &$return, $instance) ); 
    274274                } 
    275275                return $return; 
    276276        }