From 31f26dc3ce790bb80bee6c09c5340399693be8e2 Mon Sep 17 00:00:00 2001 From: Scott Taylor Date: Thu, 5 Sep 2013 16:34:09 +0000 Subject: [PATCH] Remove lingering instances of call time pass-by-reference, limited to instances of `callable` - use `$this` instead of `&$this`. Props jdgrimes. See #25160. Built from https://develop.svn.wordpress.org/trunk@25254 git-svn-id: http://core.svn.wordpress.org/trunk@25222 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/custom-background.php | 8 +-- wp-admin/custom-header.php | 12 ++--- wp-admin/includes/class-wp-importer.php | 2 +- wp-admin/includes/class-wp-list-table.php | 6 +-- .../class-wp-ms-themes-list-table.php | 4 +- .../includes/class-wp-plugins-list-table.php | 4 +- wp-admin/includes/class-wp-upgrader.php | 54 +++++++++---------- wp-admin/includes/list-table.php | 2 +- 8 files changed, 46 insertions(+), 46 deletions(-) diff --git a/wp-admin/custom-background.php b/wp-admin/custom-background.php index ac2941f28a..c9ba796463 100644 --- a/wp-admin/custom-background.php +++ b/wp-admin/custom-background.php @@ -67,11 +67,11 @@ class Custom_Background { if ( ! current_user_can('edit_theme_options') ) return; - $this->page = $page = add_theme_page(__('Background'), __('Background'), 'edit_theme_options', 'custom-background', array(&$this, 'admin_page')); + $this->page = $page = add_theme_page(__('Background'), __('Background'), 'edit_theme_options', 'custom-background', array($this, 'admin_page')); - add_action("load-$page", array(&$this, 'admin_load')); - add_action("load-$page", array(&$this, 'take_action'), 49); - add_action("load-$page", array(&$this, 'handle_upload'), 49); + add_action("load-$page", array($this, 'admin_load')); + add_action("load-$page", array($this, 'take_action'), 49); + add_action("load-$page", array($this, 'handle_upload'), 49); if ( $this->admin_header_callback ) add_action("admin_head-$page", $this->admin_header_callback, 51); diff --git a/wp-admin/custom-header.php b/wp-admin/custom-header.php index d572594fe4..9b02a3f033 100644 --- a/wp-admin/custom-header.php +++ b/wp-admin/custom-header.php @@ -84,13 +84,13 @@ class Custom_Image_Header { if ( ! current_user_can('edit_theme_options') ) return; - $this->page = $page = add_theme_page(__('Header'), __('Header'), 'edit_theme_options', 'custom-header', array(&$this, 'admin_page')); + $this->page = $page = add_theme_page(__('Header'), __('Header'), 'edit_theme_options', 'custom-header', array($this, 'admin_page')); - add_action("admin_print_scripts-$page", array(&$this, 'js_includes')); - add_action("admin_print_styles-$page", array(&$this, 'css_includes')); - add_action("admin_head-$page", array(&$this, 'help') ); - add_action("admin_head-$page", array(&$this, 'take_action'), 50); - add_action("admin_head-$page", array(&$this, 'js'), 50); + add_action("admin_print_scripts-$page", array($this, 'js_includes')); + add_action("admin_print_styles-$page", array($this, 'css_includes')); + add_action("admin_head-$page", array($this, 'help') ); + add_action("admin_head-$page", array($this, 'take_action'), 50); + add_action("admin_head-$page", array($this, 'js'), 50); if ( $this->admin_header_callback ) add_action("admin_head-$page", $this->admin_header_callback, 51); } diff --git a/wp-admin/includes/class-wp-importer.php b/wp-admin/includes/class-wp-importer.php index b017c84fcd..57ff7f4b93 100644 --- a/wp-admin/includes/class-wp-importer.php +++ b/wp-admin/includes/class-wp-importer.php @@ -179,7 +179,7 @@ class WP_Importer { */ function get_page( $url, $username = '', $password = '', $head = false ) { // Increase the timeout - add_filter( 'http_request_timeout', array( &$this, 'bump_request_timeout' ) ); + add_filter( 'http_request_timeout', array( $this, 'bump_request_timeout' ) ); $headers = array(); $args = array(); diff --git a/wp-admin/includes/class-wp-list-table.php b/wp-admin/includes/class-wp-list-table.php index 22c35f5edc..4a0ad68c4c 100644 --- a/wp-admin/includes/class-wp-list-table.php +++ b/wp-admin/includes/class-wp-list-table.php @@ -87,7 +87,7 @@ class WP_List_Table { $this->screen = convert_to_screen( $args['screen'] ); - add_filter( "manage_{$this->screen->id}_columns", array( &$this, 'get_columns' ), 0 ); + add_filter( "manage_{$this->screen->id}_columns", array( $this, 'get_columns' ), 0 ); if ( !$args['plural'] ) $args['plural'] = $this->screen->base; @@ -99,7 +99,7 @@ class WP_List_Table { if ( $args['ajax'] ) { // wp_enqueue_script( 'list-table' ); - add_action( 'admin_footer', array( &$this, '_js_vars' ) ); + add_action( 'admin_footer', array( $this, '_js_vars' ) ); } } @@ -857,7 +857,7 @@ class WP_List_Table { } elseif ( method_exists( $this, 'column_' . $column_name ) ) { echo ""; - echo call_user_func( array( &$this, 'column_' . $column_name ), $item ); + echo call_user_func( array( $this, 'column_' . $column_name ), $item ); echo ""; } else { diff --git a/wp-admin/includes/class-wp-ms-themes-list-table.php b/wp-admin/includes/class-wp-ms-themes-list-table.php index 311593d896..73045dbfc5 100644 --- a/wp-admin/includes/class-wp-ms-themes-list-table.php +++ b/wp-admin/includes/class-wp-ms-themes-list-table.php @@ -84,7 +84,7 @@ class WP_MS_Themes_List_Table extends WP_List_Table { if ( $s ) { $status = 'search'; - $themes['search'] = array_filter( array_merge( $themes['all'], $themes['broken'] ), array( &$this, '_search_callback' ) ); + $themes['search'] = array_filter( array_merge( $themes['all'], $themes['broken'] ), array( $this, '_search_callback' ) ); } $totals = array(); @@ -108,7 +108,7 @@ class WP_MS_Themes_List_Table extends WP_List_Table { if ( 'ASC' == $order ) $this->items = array_reverse( $this->items ); } else { - uasort( $this->items, array( &$this, '_order_callback' ) ); + uasort( $this->items, array( $this, '_order_callback' ) ); } } diff --git a/wp-admin/includes/class-wp-plugins-list-table.php b/wp-admin/includes/class-wp-plugins-list-table.php index ae1d1b8d8d..956840e5a1 100644 --- a/wp-admin/includes/class-wp-plugins-list-table.php +++ b/wp-admin/includes/class-wp-plugins-list-table.php @@ -99,7 +99,7 @@ class WP_Plugins_List_Table extends WP_List_Table { if ( $s ) { $status = 'search'; - $plugins['search'] = array_filter( $plugins['all'], array( &$this, '_search_callback' ) ); + $plugins['search'] = array_filter( $plugins['all'], array( $this, '_search_callback' ) ); } $totals = array(); @@ -121,7 +121,7 @@ class WP_Plugins_List_Table extends WP_List_Table { $orderby = ucfirst( $orderby ); $order = strtoupper( $order ); - uasort( $this->items, array( &$this, '_order_callback' ) ); + uasort( $this->items, array( $this, '_order_callback' ) ); } $plugins_per_page = $this->get_items_per_page( str_replace( '-', '_', $screen->id . '_per_page' ), 999 ); diff --git a/wp-admin/includes/class-wp-upgrader.php b/wp-admin/includes/class-wp-upgrader.php index 3ab054ae74..0c9e0cc5d7 100644 --- a/wp-admin/includes/class-wp-upgrader.php +++ b/wp-admin/includes/class-wp-upgrader.php @@ -403,7 +403,7 @@ class Plugin_Upgrader extends WP_Upgrader { $this->init(); $this->install_strings(); - add_filter('upgrader_source_selection', array(&$this, 'check_package') ); + add_filter('upgrader_source_selection', array($this, 'check_package') ); $this->run(array( 'package' => $package, @@ -413,7 +413,7 @@ class Plugin_Upgrader extends WP_Upgrader { 'hook_extra' => array() )); - remove_filter('upgrader_source_selection', array(&$this, 'check_package') ); + remove_filter('upgrader_source_selection', array($this, 'check_package') ); if ( ! $this->result || is_wp_error($this->result) ) return $this->result; @@ -443,9 +443,9 @@ class Plugin_Upgrader extends WP_Upgrader { // Get the URL to the zip file $r = $current->response[ $plugin ]; - add_filter('upgrader_pre_install', array(&$this, 'deactivate_plugin_before_upgrade'), 10, 2); - add_filter('upgrader_clear_destination', array(&$this, 'delete_old_plugin'), 10, 4); - //'source_selection' => array(&$this, 'source_selection'), //there's a trac ticket to move up the directory for zip's which are made a bit differently, useful for non-.org plugins. + add_filter('upgrader_pre_install', array($this, 'deactivate_plugin_before_upgrade'), 10, 2); + add_filter('upgrader_clear_destination', array($this, 'delete_old_plugin'), 10, 4); + //'source_selection' => array($this, 'source_selection'), //there's a trac ticket to move up the directory for zip's which are made a bit differently, useful for non-.org plugins. $this->run(array( 'package' => $r->package, @@ -458,8 +458,8 @@ class Plugin_Upgrader extends WP_Upgrader { )); // Cleanup our hooks, in case something else does a upgrade on this connection. - remove_filter('upgrader_pre_install', array(&$this, 'deactivate_plugin_before_upgrade')); - remove_filter('upgrader_clear_destination', array(&$this, 'delete_old_plugin')); + remove_filter('upgrader_pre_install', array($this, 'deactivate_plugin_before_upgrade')); + remove_filter('upgrader_clear_destination', array($this, 'delete_old_plugin')); if ( ! $this->result || is_wp_error($this->result) ) return $this->result; @@ -480,7 +480,7 @@ class Plugin_Upgrader extends WP_Upgrader { $current = get_site_transient( 'update_plugins' ); - add_filter('upgrader_clear_destination', array(&$this, 'delete_old_plugin'), 10, 4); + add_filter('upgrader_clear_destination', array($this, 'delete_old_plugin'), 10, 4); $this->skin->header(); @@ -550,7 +550,7 @@ class Plugin_Upgrader extends WP_Upgrader { $this->skin->footer(); // Cleanup our hooks, in case something else does a upgrade on this connection. - remove_filter('upgrader_clear_destination', array(&$this, 'delete_old_plugin')); + remove_filter('upgrader_clear_destination', array($this, 'delete_old_plugin')); // Force refresh of plugin update information delete_site_transient('update_plugins'); @@ -712,7 +712,7 @@ class Theme_Upgrader extends WP_Upgrader { if ( ! $api || is_wp_error($api) ) { $this->skin->feedback( 'parent_theme_not_found', $theme_info->get('Template') ); // Don't show activate or preview actions after install - add_filter('install_theme_complete_actions', array(&$this, 'hide_activate_preview_actions') ); + add_filter('install_theme_complete_actions', array($this, 'hide_activate_preview_actions') ); return $install_result; } @@ -737,7 +737,7 @@ class Theme_Upgrader extends WP_Upgrader { ) ); if ( is_wp_error($parent_result) ) - add_filter('install_theme_complete_actions', array(&$this, 'hide_activate_preview_actions') ); + add_filter('install_theme_complete_actions', array($this, 'hide_activate_preview_actions') ); // Start cleaning up after the parents installation remove_filter('install_theme_complete_actions', '__return_false', 999); @@ -760,8 +760,8 @@ class Theme_Upgrader extends WP_Upgrader { $this->init(); $this->install_strings(); - add_filter('upgrader_source_selection', array(&$this, 'check_package') ); - add_filter('upgrader_post_install', array(&$this, 'check_parent_theme_filter'), 10, 3); + add_filter('upgrader_source_selection', array($this, 'check_package') ); + add_filter('upgrader_post_install', array($this, 'check_parent_theme_filter'), 10, 3); $options = array( 'package' => $package, @@ -772,8 +772,8 @@ class Theme_Upgrader extends WP_Upgrader { $this->run($options); - remove_filter('upgrader_source_selection', array(&$this, 'check_package') ); - remove_filter('upgrader_post_install', array(&$this, 'check_parent_theme_filter')); + remove_filter('upgrader_source_selection', array($this, 'check_package') ); + remove_filter('upgrader_post_install', array($this, 'check_parent_theme_filter')); if ( ! $this->result || is_wp_error($this->result) ) return $this->result; @@ -802,9 +802,9 @@ class Theme_Upgrader extends WP_Upgrader { $r = $current->response[ $theme ]; - add_filter('upgrader_pre_install', array(&$this, 'current_before'), 10, 2); - add_filter('upgrader_post_install', array(&$this, 'current_after'), 10, 2); - add_filter('upgrader_clear_destination', array(&$this, 'delete_old_theme'), 10, 4); + add_filter('upgrader_pre_install', array($this, 'current_before'), 10, 2); + add_filter('upgrader_post_install', array($this, 'current_after'), 10, 2); + add_filter('upgrader_clear_destination', array($this, 'delete_old_theme'), 10, 4); $options = array( 'package' => $r['package'], @@ -818,9 +818,9 @@ class Theme_Upgrader extends WP_Upgrader { $this->run($options); - remove_filter('upgrader_pre_install', array(&$this, 'current_before')); - remove_filter('upgrader_post_install', array(&$this, 'current_after')); - remove_filter('upgrader_clear_destination', array(&$this, 'delete_old_theme')); + remove_filter('upgrader_pre_install', array($this, 'current_before')); + remove_filter('upgrader_post_install', array($this, 'current_after')); + remove_filter('upgrader_clear_destination', array($this, 'delete_old_theme')); if ( ! $this->result || is_wp_error($this->result) ) return $this->result; @@ -840,9 +840,9 @@ class Theme_Upgrader extends WP_Upgrader { $current = get_site_transient( 'update_themes' ); - add_filter('upgrader_pre_install', array(&$this, 'current_before'), 10, 2); - add_filter('upgrader_post_install', array(&$this, 'current_after'), 10, 2); - add_filter('upgrader_clear_destination', array(&$this, 'delete_old_theme'), 10, 4); + add_filter('upgrader_pre_install', array($this, 'current_before'), 10, 2); + add_filter('upgrader_post_install', array($this, 'current_after'), 10, 2); + add_filter('upgrader_clear_destination', array($this, 'delete_old_theme'), 10, 4); $this->skin->header(); @@ -912,9 +912,9 @@ class Theme_Upgrader extends WP_Upgrader { $this->skin->footer(); // Cleanup our hooks, in case something else does a upgrade on this connection. - remove_filter('upgrader_pre_install', array(&$this, 'current_before')); - remove_filter('upgrader_post_install', array(&$this, 'current_after')); - remove_filter('upgrader_clear_destination', array(&$this, 'delete_old_theme')); + remove_filter('upgrader_pre_install', array($this, 'current_before')); + remove_filter('upgrader_post_install', array($this, 'current_after')); + remove_filter('upgrader_clear_destination', array($this, 'delete_old_theme')); // Force refresh of theme update information wp_clean_themes_cache(); diff --git a/wp-admin/includes/list-table.php b/wp-admin/includes/list-table.php index 071df0dcc5..2403ec859a 100644 --- a/wp-admin/includes/list-table.php +++ b/wp-admin/includes/list-table.php @@ -95,7 +95,7 @@ class _WP_List_Table_Compat extends WP_List_Table { if ( !empty( $columns ) ) { $this->_columns = $columns; - add_filter( 'manage_' . $screen->id . '_columns', array( &$this, 'get_columns' ), 0 ); + add_filter( 'manage_' . $screen->id . '_columns', array( $this, 'get_columns' ), 0 ); } }