Ticket #16767: 16767.3.patch
File 16767.3.patch, 63.1 KB (added by , 13 years ago) |
---|
-
wp-admin/includes/class-wp-importer.php
186 186 */ 187 187 function get_page( $url, $username = '', $password = '', $head = false ) { 188 188 // Increase the timeout 189 add_filter( 'http_request_timeout', array( &$this, 'bump_request_timeout' ) );189 add_filter( 'http_request_timeout', array( $this, 'bump_request_timeout' ) ); 190 190 191 191 $headers = array(); 192 192 $args = array(); -
wp-admin/includes/class-wp-list-table.php
86 86 87 87 $screen = get_current_screen(); 88 88 89 add_filter( "manage_{$screen->id}_columns", array( &$this, 'get_columns' ), 0 );89 add_filter( "manage_{$screen->id}_columns", array( $this, 'get_columns' ), 0 ); 90 90 91 91 if ( !$args['plural'] ) 92 92 $args['plural'] = $screen->base; … … 95 95 96 96 if ( $args['ajax'] ) { 97 97 // wp_enqueue_script( 'list-table' ); 98 add_action( 'admin_footer', array( &$this, '_js_vars' ) );98 add_action( 'admin_footer', array( $this, '_js_vars' ) ); 99 99 } 100 100 } 101 101 … … 833 833 } 834 834 elseif ( method_exists( $this, 'column_' . $column_name ) ) { 835 835 echo "<td $attributes>"; 836 echo call_user_func( array( &$this, 'column_' . $column_name ), $item );836 echo call_user_func( array( $this, 'column_' . $column_name ), $item ); 837 837 echo "</td>"; 838 838 } 839 839 else { -
wp-admin/includes/class-wp-ms-themes-list-table.php
104 104 105 105 if ( $s ) { 106 106 $status = 'search'; 107 $themes['search'] = array_filter( $themes['all'], array( &$this, '_search_callback' ) );107 $themes['search'] = array_filter( $themes['all'], array( $this, '_search_callback' ) ); 108 108 } 109 109 110 110 $totals = array(); … … 121 121 $orderby = ucfirst( $orderby ); 122 122 $order = strtoupper( $order ); 123 123 124 uasort( $this->items, array( &$this, '_order_callback' ) );124 uasort( $this->items, array( $this, '_order_callback' ) ); 125 125 } 126 126 127 127 $start = ( $page - 1 ) * $themes_per_page; -
wp-admin/includes/class-wp-plugins-list-table.php
107 107 108 108 if ( $s ) { 109 109 $status = 'search'; 110 $plugins['search'] = array_filter( $plugins['all'], array( &$this, '_search_callback' ) );110 $plugins['search'] = array_filter( $plugins['all'], array( $this, '_search_callback' ) ); 111 111 } 112 112 113 113 $totals = array(); … … 129 129 $orderby = ucfirst( $orderby ); 130 130 $order = strtoupper( $order ); 131 131 132 uasort( $this->items, array( &$this, '_order_callback' ) );132 uasort( $this->items, array( $this, '_order_callback' ) ); 133 133 } 134 134 135 135 $plugins_per_page = $this->get_items_per_page( str_replace( '-', '_', $screen->id . '_per_page' ) ); -
wp-admin/includes/class-wp-upgrader.php
422 422 // Get the URL to the zip file 423 423 $r = $current->response[ $plugin ]; 424 424 425 add_filter('upgrader_pre_install', array( &$this, 'deactivate_plugin_before_upgrade'), 10, 2);426 add_filter('upgrader_clear_destination', array( &$this, 'delete_old_plugin'), 10, 4);427 //'source_selection' => array( &$this, 'source_selection'), //theres a track ticket to move up the directory for zip's which are made a bit differently, useful for non-.org plugins.425 add_filter('upgrader_pre_install', array($this, 'deactivate_plugin_before_upgrade'), 10, 2); 426 add_filter('upgrader_clear_destination', array($this, 'delete_old_plugin'), 10, 4); 427 //'source_selection' => array($this, 'source_selection'), //theres a track ticket to move up the directory for zip's which are made a bit differently, useful for non-.org plugins. 428 428 429 429 $this->run(array( 430 430 'package' => $r->package, … … 437 437 )); 438 438 439 439 // Cleanup our hooks, incase something else does a upgrade on this connection. 440 remove_filter('upgrader_pre_install', array( &$this, 'deactivate_plugin_before_upgrade'));441 remove_filter('upgrader_clear_destination', array( &$this, 'delete_old_plugin'));440 remove_filter('upgrader_pre_install', array($this, 'deactivate_plugin_before_upgrade')); 441 remove_filter('upgrader_clear_destination', array($this, 'delete_old_plugin')); 442 442 443 443 if ( ! $this->result || is_wp_error($this->result) ) 444 444 return $this->result; … … 455 455 456 456 $current = get_site_transient( 'update_plugins' ); 457 457 458 add_filter('upgrader_clear_destination', array( &$this, 'delete_old_plugin'), 10, 4);458 add_filter('upgrader_clear_destination', array($this, 'delete_old_plugin'), 10, 4); 459 459 460 460 $this->skin->header(); 461 461 … … 522 522 $this->skin->footer(); 523 523 524 524 // Cleanup our hooks, incase something else does a upgrade on this connection. 525 remove_filter('upgrader_clear_destination', array( &$this, 'delete_old_plugin'));525 remove_filter('upgrader_clear_destination', array($this, 'delete_old_plugin')); 526 526 527 527 // Force refresh of plugin update information 528 528 delete_site_transient('update_plugins'); … … 669 669 670 670 $r = $current->response[ $theme ]; 671 671 672 add_filter('upgrader_pre_install', array( &$this, 'current_before'), 10, 2);673 add_filter('upgrader_post_install', array( &$this, 'current_after'), 10, 2);674 add_filter('upgrader_clear_destination', array( &$this, 'delete_old_theme'), 10, 4);672 add_filter('upgrader_pre_install', array($this, 'current_before'), 10, 2); 673 add_filter('upgrader_post_install', array($this, 'current_after'), 10, 2); 674 add_filter('upgrader_clear_destination', array($this, 'delete_old_theme'), 10, 4); 675 675 676 676 $options = array( 677 677 'package' => $r['package'], … … 702 702 703 703 $current = get_site_transient( 'update_themes' ); 704 704 705 add_filter('upgrader_pre_install', array( &$this, 'current_before'), 10, 2);706 add_filter('upgrader_post_install', array( &$this, 'current_after'), 10, 2);707 add_filter('upgrader_clear_destination', array( &$this, 'delete_old_theme'), 10, 4);705 add_filter('upgrader_pre_install', array($this, 'current_before'), 10, 2); 706 add_filter('upgrader_post_install', array($this, 'current_after'), 10, 2); 707 add_filter('upgrader_clear_destination', array($this, 'delete_old_theme'), 10, 4); 708 708 709 709 $this->skin->header(); 710 710 … … 771 771 $this->skin->footer(); 772 772 773 773 // Cleanup our hooks, incase something else does a upgrade on this connection. 774 remove_filter('upgrader_pre_install', array( &$this, 'current_before'), 10, 2);775 remove_filter('upgrader_post_install', array( &$this, 'current_after'), 10, 2);776 remove_filter('upgrader_clear_destination', array( &$this, 'delete_old_theme'), 10, 4);774 remove_filter('upgrader_pre_install', array($this, 'current_before'), 10, 2); 775 remove_filter('upgrader_post_install', array($this, 'current_after'), 10, 2); 776 remove_filter('upgrader_clear_destination', array($this, 'delete_old_theme'), 10, 4); 777 777 778 778 // Force refresh of theme update information 779 779 delete_site_transient('update_themes'); … … 931 931 $this->options = wp_parse_args($args, $defaults); 932 932 } 933 933 934 function set_upgrader( &$upgrader) {934 function set_upgrader($upgrader) { 935 935 if ( is_object($upgrader) ) 936 $this->upgrader = &$upgrader;936 $this->upgrader = $upgrader; 937 937 $this->add_strings(); 938 938 } 939 939 -
wp-admin/includes/dashboard.php
649 649 endif; // $comments; 650 650 } 651 651 652 function _wp_dashboard_recent_comments_row( &$comment, $show_date = true ) {653 $GLOBALS['comment'] = &$comment;652 function _wp_dashboard_recent_comments_row( $comment, $show_date = true ) { 653 $GLOBALS['comment'] = $comment; 654 654 655 655 $comment_post_url = get_edit_post_link( $comment->comment_post_ID ); 656 656 $comment_post_title = strip_tags(get_the_title( $comment->comment_post_ID )); -
wp-admin/includes/deprecated.php
502 502 $this->query_where .= " AND $wpdb->users.ID = $wpdb->usermeta.user_id AND meta_key = '{$level_key}'"; 503 503 } 504 504 505 do_action _ref_array( 'pre_user_search', array( &$this ));505 do_action( 'pre_user_search', $this ); 506 506 } 507 507 508 508 /** -
wp-admin/includes/list-table.php
85 85 86 86 if ( !empty( $columns ) ) { 87 87 $this->_columns = $columns; 88 add_filter( 'manage_' . $screen->id . '_columns', array( &$this, 'get_columns' ), 0 );88 add_filter( 'manage_' . $screen->id . '_columns', array( $this, 'get_columns' ), 0 ); 89 89 } 90 90 } 91 91 -
wp-admin/includes/template.php
135 135 } 136 136 137 137 // Put checked cats on top 138 echo call_user_func_array(array( &$walker, 'walk'), array($checked_categories, 0, $args));138 echo call_user_func_array(array($walker, 'walk'), array($checked_categories, 0, $args)); 139 139 } 140 140 // Then the rest of them 141 echo call_user_func_array(array( &$walker, 'walk'), array($categories, 0, $args));141 echo call_user_func_array(array($walker, 'walk'), array($categories, 0, $args)); 142 142 } 143 143 144 144 /** -
wp-admin/includes/user.php
176 176 } 177 177 178 178 // 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 ); 180 180 181 181 if ( $errors->get_error_codes() ) 182 182 return $errors; -
wp-admin/custom-background.php
64 64 if ( ! current_user_can('edit_theme_options') ) 65 65 return; 66 66 67 $this->page = $page = add_theme_page(__('Background'), __('Background'), 'edit_theme_options', 'custom-background', array( &$this, 'admin_page'));67 $this->page = $page = add_theme_page(__('Background'), __('Background'), 'edit_theme_options', 'custom-background', array($this, 'admin_page')); 68 68 69 add_action("load-$page", array( &$this, 'admin_load'));70 add_action("load-$page", array( &$this, 'take_action'), 49);71 add_action("load-$page", array( &$this, 'handle_upload'), 49);69 add_action("load-$page", array($this, 'admin_load')); 70 add_action("load-$page", array($this, 'take_action'), 49); 71 add_action("load-$page", array($this, 'handle_upload'), 49); 72 72 73 73 if ( $this->admin_header_callback ) 74 74 add_action("admin_head-$page", $this->admin_header_callback, 51); -
wp-admin/custom-header.php
73 73 if ( ! current_user_can('edit_theme_options') ) 74 74 return; 75 75 76 $this->page = $page = add_theme_page(__('Header'), __('Header'), 'edit_theme_options', 'custom-header', array( &$this, 'admin_page'));76 $this->page = $page = add_theme_page(__('Header'), __('Header'), 'edit_theme_options', 'custom-header', array($this, 'admin_page')); 77 77 78 add_action("admin_print_scripts-$page", array( &$this, 'js_includes'));79 add_action("admin_print_styles-$page", array( &$this, 'css_includes'));80 add_action("admin_head-$page", array( &$this, 'help') );81 add_action("admin_head-$page", array( &$this, 'take_action'), 50);82 add_action("admin_head-$page", array( &$this, 'js'), 50);78 add_action("admin_print_scripts-$page", array($this, 'js_includes')); 79 add_action("admin_print_styles-$page", array($this, 'css_includes')); 80 add_action("admin_head-$page", array($this, 'help') ); 81 add_action("admin_head-$page", array($this, 'take_action'), 50); 82 add_action("admin_head-$page", array($this, 'js'), 50); 83 83 add_action("admin_head-$page", $this->admin_header_callback, 51); 84 84 } 85 85 -
wp-includes/pomo/po.php
175 175 * Builds a string from the entry for inclusion in PO file 176 176 * 177 177 * @static 178 * @param object &$entry the entry to convert to po string178 * @param object $entry the entry to convert to po string 179 179 * @return string|bool PO-style formatted string for the entry or 180 180 * false if the entry is empty 181 181 */ 182 function export_entry( &$entry) {182 function export_entry($entry) { 183 183 if (is_null($entry->singular)) return false; 184 184 $po = array(); 185 185 if (!empty($entry->translator_comments)) $po[] = PO::comment_block($entry->translator_comments); … … 340 340 return $line; 341 341 } 342 342 343 function add_comment_to_entry( &$entry, $po_comment_line) {343 function add_comment_to_entry($entry, $po_comment_line) { 344 344 $first_two = substr($po_comment_line, 0, 2); 345 345 $comment = trim(substr($po_comment_line, 2)); 346 346 if ('#:' == $first_two) { -
wp-includes/pomo/translations.php
44 44 $this->headers[$header] = $value; 45 45 } 46 46 47 function set_headers( &$headers) {47 function set_headers($headers) { 48 48 foreach($headers as $header => $value) { 49 49 $this->set_header($header, $value); 50 50 } … … 54 54 return isset($this->headers[$header])? $this->headers[$header] : false; 55 55 } 56 56 57 function translate_entry( &$entry) {57 function translate_entry($entry) { 58 58 $key = $entry->key(); 59 59 return isset($this->entries[$key])? $this->entries[$key] : false; 60 60 } … … 103 103 * @param Object &$other Another Translation object, whose translations will be merged in this one 104 104 * @return void 105 105 **/ 106 function merge_with( &$other) {106 function merge_with($other) { 107 107 foreach( $other->entries as $entry ) { 108 108 $this->entries[$entry->key()] = $entry; 109 109 } … … 220 220 function set_header($header, $value) { 221 221 } 222 222 223 function set_headers( &$headers) {223 function set_headers($headers) { 224 224 } 225 225 226 226 function get_header($header) { 227 227 return false; 228 228 } 229 229 230 function translate_entry( &$entry) {230 function translate_entry($entry) { 231 231 return false; 232 232 } 233 233 … … 247 247 return 1 == $count? $singular : $plural; 248 248 } 249 249 250 function merge_with( &$other) {250 function merge_with($other) { 251 251 } 252 252 } 253 253 endif; -
wp-includes/admin-bar.php
57 57 58 58 $wp_admin_bar->load_user_locale_translations(); 59 59 60 do_action _ref_array( 'admin_bar_menu', array( &$wp_admin_bar ));60 do_action( 'admin_bar_menu', $wp_admin_bar ); 61 61 62 62 do_action( 'wp_before_admin_bar_render' ); 63 63 -
wp-includes/cache.php
100 100 * @global WP_Object_Cache $wp_object_cache WordPress Object Cache 101 101 */ 102 102 function wp_cache_init() { 103 $GLOBALS['wp_object_cache'] = &new WP_Object_Cache();103 $GLOBALS['wp_object_cache'] = new WP_Object_Cache(); 104 104 } 105 105 106 106 /** … … 478 478 * @todo This should be moved to the PHP4 style constructor, PHP5 479 479 * already calls __destruct() 480 480 */ 481 register_shutdown_function(array( &$this, "__destruct"));481 register_shutdown_function(array($this, "__destruct")); 482 482 } 483 483 484 484 /** -
wp-includes/capabilities.php
208 208 * @param string $role Role name. 209 209 * @return object|null Null, if role does not exist. WP_Role object, if found. 210 210 */ 211 function &get_role( $role ) {211 function get_role( $role ) { 212 212 if ( isset( $this->role_objects[$role] ) ) 213 213 return $this->role_objects[$role]; 214 214 else … … 545 545 546 546 //Filter out caps that are not role names and assign to $this->roles 547 547 if ( is_array( $this->caps ) ) 548 $this->roles = array_filter( array_keys( $this->caps ), array( &$wp_roles, 'is_role' ) );548 $this->roles = array_filter( array_keys( $this->caps ), array( $wp_roles, 'is_role' ) ); 549 549 550 550 //Build $allcaps from role caps, overlay user's $caps 551 551 $this->allcaps = array(); 552 552 foreach ( (array) $this->roles as $role ) { 553 $the_role = &$wp_roles->get_role( $role );553 $the_role = $wp_roles->get_role( $role ); 554 554 $this->allcaps = array_merge( (array) $this->allcaps, (array) $the_role->capabilities ); 555 555 } 556 556 $this->allcaps = array_merge( (array) $this->allcaps, (array) $this->caps ); … … 661 661 */ 662 662 function update_user_level_from_caps() { 663 663 global $wpdb; 664 $this->user_level = array_reduce( array_keys( $this->allcaps ), array( &$this, 'level_reduction' ), 0 );664 $this->user_level = array_reduce( array_keys( $this->allcaps ), array( $this, 'level_reduction' ), 0 ); 665 665 update_user_meta( $this->ID, $wpdb->prefix . 'user_level', $this->user_level ); 666 666 } 667 667 … … 1033 1033 $args = array_slice( func_get_args(), 1 ); 1034 1034 $args = array_merge( array( $capability ), $args ); 1035 1035 1036 return call_user_func_array( array( &$current_user, 'has_cap' ), $args );1036 return call_user_func_array( array( $current_user, 'has_cap' ), $args ); 1037 1037 } 1038 1038 1039 1039 /** … … 1060 1060 $args = array_slice( func_get_args(), 2 ); 1061 1061 $args = array_merge( array( $capability ), $args ); 1062 1062 1063 return call_user_func_array( array( &$user, 'has_cap' ), $args );1063 return call_user_func_array( array( $user, 'has_cap' ), $args ); 1064 1064 } 1065 1065 1066 1066 /** … … 1084 1084 $args = array_slice( func_get_args(), 2 ); 1085 1085 $args = array_merge( array( $capability ), $args ); 1086 1086 1087 return call_user_func_array( array( &$author, 'has_cap' ), $args );1087 return call_user_func_array( array( $author, 'has_cap' ), $args ); 1088 1088 } 1089 1089 1090 1090 /** … … 1106 1106 $args = array_slice( func_get_args(), 2 ); 1107 1107 $args = array_merge( array( $capability ), $args ); 1108 1108 1109 return call_user_func_array( array( &$user, 'has_cap' ), $args );1109 return call_user_func_array( array( $user, 'has_cap' ), $args ); 1110 1110 } 1111 1111 1112 1112 /** -
wp-includes/category-template.php
742 742 else 743 743 $walker = $args[2]['walker']; 744 744 745 return call_user_func_array(array( &$walker, 'walk' ), $args );745 return call_user_func_array(array( $walker, 'walk' ), $args ); 746 746 } 747 747 748 748 /** … … 760 760 else 761 761 $walker = $args[2]['walker']; 762 762 763 return call_user_func_array(array( &$walker, 'walk' ), $args );763 return call_user_func_array(array( $walker, 'walk' ), $args ); 764 764 } 765 765 766 766 /** -
wp-includes/class-oembed.php
57 57 ) ); 58 58 59 59 // Fix any embeds that contain new lines in the middle of the HTML which breaks wpautop(). 60 add_filter( 'oembed_dataparse', array( &$this, '_strip_newlines'), 10, 3 );60 add_filter( 'oembed_dataparse', array($this, '_strip_newlines'), 10, 3 ); 61 61 } 62 62 63 63 /** -
wp-includes/class-wp-walker.php
126 126 if ( is_array( $args[0] ) ) 127 127 $args[0]['has_children'] = ! empty( $children_elements[$element->$id_field] ); 128 128 $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); 130 130 131 131 $id = $element->$id_field; 132 132 … … 139 139 $newlevel = true; 140 140 //start the child delimiter 141 141 $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); 143 143 } 144 144 $this->display_element( $child, $children_elements, $max_depth, $depth + 1, $args, $output ); 145 145 } … … 149 149 if ( isset($newlevel) && $newlevel ){ 150 150 //end the child delimiter 151 151 $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); 153 153 } 154 154 155 155 //end this element 156 156 $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); 158 158 } 159 159 160 160 /** -
wp-includes/class-wp.php
298 298 299 299 $this->query_vars = apply_filters('request', $this->query_vars); 300 300 301 do_action _ref_array('parse_request', array(&$this));301 do_action( 'parse_request', $this ); 302 302 } 303 303 304 304 /** … … 373 373 if ( $exit_required ) 374 374 exit(); 375 375 376 do_action _ref_array('send_headers', array(&$this));376 do_action( 'send_headers', $this ); 377 377 } 378 378 379 379 /** … … 501 501 $this->query_posts(); 502 502 $this->handle_404(); 503 503 $this->register_globals(); 504 do_action _ref_array('wp', array(&$this));504 do_action( 'wp', $this ); 505 505 } 506 506 507 507 /** … … 579 579 * @return string 580 580 */ 581 581 function apply($subject, $matches) { 582 $oSelf = &new WP_MatchesMapRegex($subject, $matches);582 $oSelf = new WP_MatchesMapRegex($subject, $matches); 583 583 return $oSelf->output; 584 584 } 585 585 … … 590 590 * @return string 591 591 */ 592 592 function _map() { 593 $callback = array( &$this, 'callback');593 $callback = array($this, 'callback'); 594 594 return preg_replace_callback($this->_pattern, $callback, $this->_subject); 595 595 } 596 596 -
wp-includes/class.wp-dependencies.php
27 27 28 28 function WP_Dependencies() { 29 29 $args = func_get_args(); 30 call_user_func_array( array( &$this, '__construct'), $args );30 call_user_func_array( array($this, '__construct'), $args ); 31 31 } 32 32 33 33 function __construct() {} -
wp-includes/class.wp-scripts.php
31 31 var $default_dirs; 32 32 33 33 function __construct() { 34 do_action _ref_array( 'wp_default_scripts', array(&$this));34 do_action( 'wp_default_scripts', $this ); 35 35 } 36 36 37 37 /** -
wp-includes/class.wp-styles.php
28 28 var $default_dirs; 29 29 30 30 function __construct() { 31 do_action _ref_array( 'wp_default_styles', array(&$this));31 do_action( 'wp_default_styles', $this ); 32 32 } 33 33 34 34 function do_item( $handle ) { -
wp-includes/comment.php
127 127 * @param string $output Optional. OBJECT or ARRAY_A or ARRAY_N constants. 128 128 * @return object|array|null Depends on $output value. 129 129 */ 130 function &get_comment(&$comment, $output = OBJECT) {130 function get_comment($comment, $output = OBJECT) { 131 131 global $wpdb; 132 132 $null = null; 133 133 134 134 if ( empty($comment) ) { 135 135 if ( isset($GLOBALS['comment']) ) 136 $ _comment = &$GLOBALS['comment'];136 $comment = $GLOBALS['comment']; 137 137 else 138 $ _comment = null;138 $comment = null; 139 139 } elseif ( is_object($comment) ) { 140 140 wp_cache_add($comment->comment_ID, $comment, 'comment'); 141 $_comment = $comment;142 141 } else { 143 142 if ( isset($GLOBALS['comment']) && ($GLOBALS['comment']->comment_ID == $comment) ) { 144 $ _comment = &$GLOBALS['comment'];145 } elseif ( ! $ _comment = wp_cache_get($comment, 'comment') ) {146 $ _comment = $wpdb->get_row($wpdb->prepare("SELECT * FROM $wpdb->comments WHERE comment_ID = %d LIMIT 1", $comment));147 if ( ! $ _comment )143 $comment = $GLOBALS['comment']; 144 } elseif ( ! $comment = wp_cache_get($comment, 'comment') ) { 145 $comment = $wpdb->get_row($wpdb->prepare("SELECT * FROM $wpdb->comments WHERE comment_ID = %d LIMIT 1", $comment)); 146 if ( ! $comment ) 148 147 return $null; 149 wp_cache_add($ _comment->comment_ID, $_comment, 'comment');148 wp_cache_add($comment->comment_ID, $comment, 'comment'); 150 149 } 151 150 } 152 151 153 $ _comment = apply_filters('get_comment', $_comment);152 $comment = apply_filters('get_comment', $comment); 154 153 155 154 if ( $output == OBJECT ) { 156 return $ _comment;155 return $comment; 157 156 } elseif ( $output == ARRAY_A ) { 158 $__comment = get_object_vars($_comment); 159 return $__comment; 157 return get_object_vars($comment); 160 158 } elseif ( $output == ARRAY_N ) { 161 $__comment = array_values(get_object_vars($_comment)); 162 return $__comment; 159 return array_values(get_object_vars($comment)); 163 160 } else { 164 return $ _comment;161 return $comment; 165 162 } 166 163 } 167 164 … … 221 218 ); 222 219 223 220 $this->query_vars = wp_parse_args( $query_vars, $defaults ); 224 do_action _ref_array( 'pre_get_comments', array( &$this ));221 do_action( 'pre_get_comments', $this ); 225 222 extract( $this->query_vars, EXTR_SKIP ); 226 223 227 224 // $args can be whatever, only use the args defined in defaults to compute the key … … 320 317 $where .= $this->get_search_sql( $search, array( 'comment_author', 'comment_author_email', 'comment_author_url', 'comment_author_IP', 'comment_content' ) ); 321 318 322 319 $pieces = array( 'fields', 'join', 'where', 'orderby', 'order', 'limits' ); 323 $clauses = apply_filters _ref_array( 'comments_clauses', array( compact( $pieces ), &$this ));320 $clauses = apply_filters( 'comments_clauses', compact( $pieces ), $this ); 324 321 foreach ( $pieces as $piece ) 325 322 $$piece = isset( $clauses[ $piece ] ) ? $clauses[ $piece ] : ''; 326 323 … … 330 327 return $wpdb->get_var( $query ); 331 328 332 329 $comments = $wpdb->get_results( $query ); 333 $comments = apply_filters _ref_array( 'the_comments', array( $comments, &$this ));330 $comments = apply_filters( 'the_comments', $comments, $this ); 334 331 335 332 wp_cache_add( $cache_key, $comments, 'comment' ); 336 333 … … 688 685 * @param array $comments Array of comments 689 686 * @return array Array of comments keyed by comment_type. 690 687 */ 691 function &separate_comments(&$comments) {688 function separate_comments($comments) { 692 689 $comments_by_type = array('comment' => array(), 'trackback' => array(), 'pingback' => array(), 'pings' => array()); 693 690 $count = count($comments); 694 691 for ( $i = 0; $i < $count; $i++ ) { -
wp-includes/default-widgets.php
514 514 $this->WP_Widget('recent-posts', __('Recent Posts'), $widget_ops); 515 515 $this->alt_option_name = 'widget_recent_entries'; 516 516 517 add_action( 'save_post', array( &$this, 'flush_widget_cache') );518 add_action( 'deleted_post', array( &$this, 'flush_widget_cache') );519 add_action( 'switch_theme', array( &$this, 'flush_widget_cache') );517 add_action( 'save_post', array($this, 'flush_widget_cache') ); 518 add_action( 'deleted_post', array($this, 'flush_widget_cache') ); 519 add_action( 'switch_theme', array($this, 'flush_widget_cache') ); 520 520 } 521 521 522 522 function widget($args, $instance) { … … 601 601 $this->alt_option_name = 'widget_recent_comments'; 602 602 603 603 if ( is_active_widget(false, false, $this->id_base) ) 604 add_action( 'wp_head', array( &$this, 'recent_comments_style') );604 add_action( 'wp_head', array($this, 'recent_comments_style') ); 605 605 606 add_action( 'comment_post', array( &$this, 'flush_widget_cache') );607 add_action( 'transition_comment_status', array( &$this, 'flush_widget_cache') );606 add_action( 'comment_post', array($this, 'flush_widget_cache') ); 607 add_action( 'transition_comment_status', array($this, 'flush_widget_cache') ); 608 608 } 609 609 610 610 function recent_comments_style() { -
wp-includes/feed.php
535 535 $feed->set_cache_class('WP_Feed_Cache'); 536 536 $feed->set_file_class('WP_SimplePie_File'); 537 537 $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 ); 539 539 $feed->init(); 540 540 $feed->handle_content_type(); 541 541 -
wp-includes/http.php
116 116 * @param array $response HTTP response. 117 117 * @return array The headers of the response. Empty array if incorrect parameter given. 118 118 */ 119 function wp_remote_retrieve_headers( &$response) {119 function wp_remote_retrieve_headers($response) { 120 120 if ( is_wp_error($response) || ! isset($response['headers']) || ! is_array($response['headers'])) 121 121 return array(); 122 122 … … 132 132 * @param string $header Header name to retrieve value from. 133 133 * @return string The header value. Empty string on if incorrect parameter given, or if the header doesnt exist. 134 134 */ 135 function wp_remote_retrieve_header( &$response, $header) {135 function wp_remote_retrieve_header($response, $header) { 136 136 if ( is_wp_error($response) || ! isset($response['headers']) || ! is_array($response['headers'])) 137 137 return ''; 138 138 … … 152 152 * @param array $response HTTP response. 153 153 * @return string the response code. Empty string on incorrect parameter given. 154 154 */ 155 function wp_remote_retrieve_response_code( &$response) {155 function wp_remote_retrieve_response_code($response) { 156 156 if ( is_wp_error($response) || ! isset($response['response']) || ! is_array($response['response'])) 157 157 return ''; 158 158 … … 169 169 * @param array $response HTTP response. 170 170 * @return string The response message. Empty string on incorrect parameter given. 171 171 */ 172 function wp_remote_retrieve_response_message( &$response) {172 function wp_remote_retrieve_response_message($response) { 173 173 if ( is_wp_error($response) || ! isset($response['response']) || ! is_array($response['response'])) 174 174 return ''; 175 175 … … 184 184 * @param array $response HTTP response. 185 185 * @return string The body of the response. Empty string if no body or incorrect parameter given. 186 186 */ 187 function wp_remote_retrieve_body( &$response) {187 function wp_remote_retrieve_body($response) { 188 188 if ( is_wp_error($response) || ! isset($response['body']) ) 189 189 return ''; 190 190 -
wp-includes/l10n.php
483 483 function &get_translations_for_domain( $domain ) { 484 484 global $l10n; 485 485 if ( !isset( $l10n[$domain] ) ) { 486 $l10n[$domain] = &new NOOP_Translations;486 $l10n[$domain] = new NOOP_Translations; 487 487 } 488 488 return $l10n[$domain]; 489 489 } -
wp-includes/media.php
1036 1036 */ 1037 1037 function __construct() { 1038 1038 // Hack to get the [embed] shortcode to run before wpautop() 1039 add_filter( 'the_content', array( &$this, 'run_shortcode'), 8 );1039 add_filter( 'the_content', array($this, 'run_shortcode'), 8 ); 1040 1040 1041 1041 // Shortcode placeholder for strip_shortcodes() 1042 1042 add_shortcode( 'embed', '__return_false' ); 1043 1043 1044 1044 // Attempts to embed all URLs in a post 1045 1045 if ( get_option('embed_autourls') ) 1046 add_filter( 'the_content', array( &$this, 'autoembed'), 8 );1046 add_filter( 'the_content', array($this, 'autoembed'), 8 ); 1047 1047 1048 1048 // After a post is saved, invalidate the oEmbed cache 1049 add_action( 'save_post', array( &$this, 'delete_oembed_caches') );1049 add_action( 'save_post', array($this, 'delete_oembed_caches') ); 1050 1050 1051 1051 // After a post is saved, cache oEmbed items via AJAX 1052 add_action( 'edit_form_advanced', array( &$this, 'maybe_run_ajax_cache') );1052 add_action( 'edit_form_advanced', array($this, 'maybe_run_ajax_cache') ); 1053 1053 } 1054 1054 1055 1055 /** … … 1074 1074 $orig_shortcode_tags = $shortcode_tags; 1075 1075 remove_all_shortcodes(); 1076 1076 1077 add_shortcode( 'embed', array( &$this, 'shortcode') );1077 add_shortcode( 'embed', array($this, 'shortcode') ); 1078 1078 1079 1079 // Do the shortcode (only the [embed] one is registered) 1080 1080 $content = do_shortcode( $content ); … … 1264 1264 * @return string Potentially modified $content. 1265 1265 */ 1266 1266 function autoembed( $content ) { 1267 return preg_replace_callback( '|^\s*(https?://[^\s"]+)\s*$|im', array( &$this, 'autoembed_callback'), $content );1267 return preg_replace_callback( '|^\s*(https?://[^\s"]+)\s*$|im', array($this, 'autoembed_callback'), $content ); 1268 1268 } 1269 1269 1270 1270 /** -
wp-includes/meta.php
442 442 $where .= $wpdb->prepare( " AND CAST($alias.meta_value AS {$meta_type}) {$meta_compare} {$meta_compare_string}", $meta_value ); 443 443 } 444 444 445 return apply_filters _ref_array( 'get_meta_sql', array( compact( 'join', 'where' ), $meta_query, $meta_type, $primary_table, $primary_id_column, &$context ) );445 return apply_filters( 'get_meta_sql', array( compact( 'join', 'where' ), $meta_query, $meta_type, $primary_table, $primary_id_column, $context ) ); 446 446 } 447 447 448 448 /** -
wp-includes/nav-menu-template.php
470 470 $walker = ( empty($r->walker) ) ? new Walker_Nav_Menu : $r->walker; 471 471 $args = array( $items, $depth, $r ); 472 472 473 return call_user_func_array( array( &$walker, 'walk'), $args );473 return call_user_func_array( array($walker, 'walk'), $args ); 474 474 } 475 475 476 476 /** -
wp-includes/pluggable.php
256 256 * @uses apply_filters() Calls 'wp_mail_from_name' hook to get the from address name. 257 257 * @uses apply_filters() Calls 'wp_mail_content_type' hook to get the email content type. 258 258 * @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 to259 * @uses do_action() Calls 'phpmailer_init' hook on the reference to 260 260 * phpmailer object. 261 261 * @uses PHPMailer 262 262 * @ … … 459 459 } 460 460 } 461 461 462 do_action _ref_array( 'phpmailer_init', array( &$phpmailer ));462 do_action( 'phpmailer_init', $phpmailer ); 463 463 464 464 // Send! 465 465 $result = @$phpmailer->Send(); … … 1188 1188 * 1189 1189 * @param object $user User Object 1190 1190 */ 1191 function wp_password_change_notification( &$user) {1191 function wp_password_change_notification($user) { 1192 1192 // send a copy of password change notification to the admin 1193 1193 // but check to see if it's the admin whose password we're changing, and skip this 1194 1194 if ( $user->user_email != get_option('admin_email') ) { -
wp-includes/plugin.php
374 374 } 375 375 376 376 $args = array(); 377 if ( is_array($arg) && 1 == count($arg) && isset($arg[0]) && is_object($arg[0]) ) // array( &$this)377 if ( is_array($arg) && 1 == count($arg) && isset($arg[0]) && is_object($arg[0]) ) // array($this) 378 378 $args[] =& $arg[0]; 379 379 else 380 380 $args[] = $arg; -
wp-includes/post-template.php
935 935 $walker = $r['walker']; 936 936 937 937 $args = array($pages, $depth, $r, $current_page); 938 return call_user_func_array(array( &$walker, 'walk'), $args);938 return call_user_func_array(array($walker, 'walk'), $args); 939 939 } 940 940 941 941 /** … … 952 952 else 953 953 $walker = $args[2]['walker']; 954 954 955 return call_user_func_array(array( &$walker, 'walk'), $args);955 return call_user_func_array(array($walker, 'walk'), $args); 956 956 } 957 957 958 958 /** -
wp-includes/post.php
359 359 * @param string $filter Optional, default is raw. 360 360 * @return mixed Post data 361 361 */ 362 function &get_post(&$post, $output = OBJECT, $filter = 'raw') {362 function get_post($post, $output = OBJECT, $filter = 'raw') { 363 363 global $wpdb; 364 364 $null = null; 365 365 366 366 if ( empty($post) ) { 367 367 if ( isset($GLOBALS['post']) ) 368 $ _post = &$GLOBALS['post'];368 $post = $GLOBALS['post']; 369 369 else 370 370 return $null; 371 371 } elseif ( is_object($post) && empty($post->filter) ) { 372 372 _get_post_ancestors($post); 373 $ _post = sanitize_post($post, 'raw');374 wp_cache_add($post->ID, $ _post, 'posts');373 $post = sanitize_post($post, 'raw'); 374 wp_cache_add($post->ID, $post, 'posts'); 375 375 } else { 376 376 if ( is_object($post) ) 377 377 $post_id = $post->ID; … … 379 379 $post_id = $post; 380 380 381 381 $post_id = (int) $post_id; 382 if ( ! $ _post = wp_cache_get($post_id, 'posts') ) {383 $ _post = $wpdb->get_row($wpdb->prepare("SELECT * FROM $wpdb->posts WHERE ID = %d LIMIT 1", $post_id));384 if ( ! $ _post )382 if ( ! $post = wp_cache_get($post_id, 'posts') ) { 383 $post = $wpdb->get_row($wpdb->prepare("SELECT * FROM $wpdb->posts WHERE ID = %d LIMIT 1", $post_id)); 384 if ( ! $post ) 385 385 return $null; 386 _get_post_ancestors($ _post);387 $ _post = sanitize_post($_post, 'raw');388 wp_cache_add($ _post->ID, $_post, 'posts');386 _get_post_ancestors($post); 387 $post = sanitize_post($post, 'raw'); 388 wp_cache_add($post->ID, $post, 'posts'); 389 389 } 390 390 } 391 391 392 392 if ($filter != 'raw') 393 $ _post = sanitize_post($_post, $filter);393 $post = sanitize_post($post, $filter); 394 394 395 395 if ( $output == OBJECT ) { 396 return $ _post;396 return $post; 397 397 } elseif ( $output == ARRAY_A ) { 398 $__post = get_object_vars($_post); 399 return $__post; 398 return get_object_vars($post); 400 399 } elseif ( $output == ARRAY_N ) { 401 $__post = array_values(get_object_vars($_post)); 402 return $__post; 400 return array_values(get_object_vars($_post)); 403 401 } else { 404 return $ _post;402 return $post; 405 403 } 406 404 } 407 405 … … 3110 3108 * @param string $filter How the return value should be filtered. 3111 3109 * @return mixed Page data. 3112 3110 */ 3113 function &get_page(&$page, $output = OBJECT, $filter = 'raw') { 3114 $p = get_post($page, $output, $filter); 3115 return $p; 3111 function get_page($page, $output = OBJECT, $filter = 'raw') { 3112 return get_post($page, $output, $filter); 3116 3113 } 3117 3114 3118 3115 /** … … 4194 4191 $add_seconds_server = date('Z'); 4195 4192 4196 4193 $post_types = get_post_types( array( 'publicly_queryable' => true ) ); 4197 array_walk( $post_types, array( &$wpdb, 'escape_by_ref' ) );4194 array_walk( $post_types, array( $wpdb, 'escape_by_ref' ) ); 4198 4195 $post_types = "'" . implode( "', '", $post_types ) . "'"; 4199 4196 4200 4197 switch ( $timezone ) { … … 4227 4224 * 4228 4225 * @param array $posts Array of post objects 4229 4226 */ 4230 function update_post_cache( &$posts) {4227 function update_post_cache($posts) { 4231 4228 if ( !$posts ) 4232 4229 return; 4233 4230 … … 4298 4295 * 4299 4296 * @param array $pages list of page objects 4300 4297 */ 4301 function update_page_cache( &$pages) {4298 function update_page_cache($pages) { 4302 4299 update_post_cache($pages); 4303 4300 } 4304 4301 … … 4342 4339 * @param bool $update_term_cache Whether to update the term cache. Default is true. 4343 4340 * @param bool $update_meta_cache Whether to update the meta cache. Default is true. 4344 4341 */ 4345 function update_post_caches( &$posts, $post_type = 'post', $update_term_cache = true, $update_meta_cache = true) {4342 function update_post_caches($posts, $post_type = 'post', $update_term_cache = true, $update_meta_cache = true) { 4346 4343 // No point in doing all this work if we didn't match any posts. 4347 4344 if ( !$posts ) 4348 4345 return; … … 4573 4570 * @param object $_post Post data. 4574 4571 * @return null When nothing needs to be done. 4575 4572 */ 4576 function _get_post_ancestors( &$_post) {4573 function _get_post_ancestors($_post) { 4577 4574 global $wpdb; 4578 4575 4579 4576 if ( isset($_post->ancestors) ) … … 4836 4833 * @param string $filter Optional sanitation filter. @see sanitize_post() 4837 4834 * @return mixed Null if error or post object if success 4838 4835 */ 4839 function &wp_get_post_revision(&$post, $output = OBJECT, $filter = 'raw') {4836 function wp_get_post_revision($post, $output = OBJECT, $filter = 'raw') { 4840 4837 $null = null; 4841 4838 if ( !$revision = get_post( $post, OBJECT, $filter ) ) 4842 4839 return $revision; … … 4846 4843 if ( $output == OBJECT ) { 4847 4844 return $revision; 4848 4845 } elseif ( $output == ARRAY_A ) { 4849 $_revision = get_object_vars($revision); 4850 return $_revision; 4846 return get_object_vars($revision); 4851 4847 } elseif ( $output == ARRAY_N ) { 4852 $_revision = array_values(get_object_vars($revision)); 4853 return $_revision; 4848 return array_values(get_object_vars($revision)); 4854 4849 } 4855 4850 4856 4851 return $revision; -
wp-includes/query.php
89 89 */ 90 90 function &query_posts($query) { 91 91 unset($GLOBALS['wp_query']); 92 $GLOBALS['wp_query'] = &new WP_Query();92 $GLOBALS['wp_query'] = new WP_Query(); 93 93 return $GLOBALS['wp_query']->query($query); 94 94 } 95 95 … … 1627 1627 if ( '404' == $qv['error'] ) 1628 1628 $this->set_404(); 1629 1629 1630 do_action _ref_array('parse_query', array(&$this));1630 do_action( 'parse_query', $this ); 1631 1631 } 1632 1632 1633 1633 /* … … 1868 1868 * 1869 1869 * @since 1.5.0 1870 1870 * @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. 1872 1872 * 1873 1873 * @return array List of posts. 1874 1874 */ … … 1877 1877 1878 1878 $this->parse_query(); 1879 1879 1880 do_action _ref_array('pre_get_posts', array(&$this));1880 do_action( 'pre_get_posts', $this ); 1881 1881 1882 1882 // Shorthand. 1883 1883 $q = &$this->query_vars; … … 2147 2147 } 2148 2148 2149 2149 // Allow plugins to contextually add/remove/modify the search section of the database query 2150 $search = apply_filters _ref_array('posts_search', array( $search, &$this ));2150 $search = apply_filters( 'posts_search', $search, $this ); 2151 2151 2152 2152 // Taxonomies 2153 2153 if ( !$this->is_singular ) { … … 2445 2445 } 2446 2446 2447 2447 if ( !empty( $q['meta_query'] ) ) { 2448 $clauses = call_user_func_array( '_get_meta_sql', array( $q['meta_query'], 'post', $wpdb->posts, 'ID', &$this) );2448 $clauses = call_user_func_array( '_get_meta_sql', array( $q['meta_query'], 'post', $wpdb->posts, 'ID', $this) ); 2449 2449 $join .= $clauses['join']; 2450 2450 $where .= $clauses['where']; 2451 2451 } … … 2453 2453 // Apply filters on where and join prior to paging so that any 2454 2454 // manipulations to them are reflected in the paging by day queries. 2455 2455 if ( !$q['suppress_filters'] ) { 2456 $where = apply_filters _ref_array('posts_where', array( $where, &$this ));2457 $join = apply_filters _ref_array('posts_join', array( $join, &$this ));2456 $where = apply_filters( 'posts_where', $where, $this ); 2457 $join = apply_filters( 'posts_join', $join, $this ); 2458 2458 } 2459 2459 2460 2460 // Paging … … 2487 2487 } 2488 2488 2489 2489 if ( !$q['suppress_filters'] ) { 2490 $cjoin = apply_filters _ref_array('comment_feed_join', array( $cjoin, &$this ));2491 $cwhere = apply_filters _ref_array('comment_feed_where', array( $cwhere, &$this ));2492 $cgroupby = apply_filters _ref_array('comment_feed_groupby', array( $cgroupby, &$this ));2493 $corderby = apply_filters _ref_array('comment_feed_orderby', array( 'comment_date_gmt DESC', &$this ));2494 $climits = apply_filters _ref_array('comment_feed_limits', array( 'LIMIT ' . get_option('posts_per_rss'), &$this ));2490 $cjoin = apply_filters('comment_feed_join', $cjoin, $this ); 2491 $cwhere = apply_filters('comment_feed_where', $cwhere, $this ); 2492 $cgroupby = apply_filters('comment_feed_groupby', $cgroupby, $this ); 2493 $corderby = apply_filters('comment_feed_orderby', 'comment_date_gmt DESC', $this ); 2494 $climits = apply_filters('comment_feed_limits', 'LIMIT ' . get_option('posts_per_rss'), $this ); 2495 2495 } 2496 2496 $cgroupby = ( ! empty( $cgroupby ) ) ? 'GROUP BY ' . $cgroupby : ''; 2497 2497 $corderby = ( ! empty( $corderby ) ) ? 'ORDER BY ' . $corderby : ''; … … 2519 2519 // Apply post-paging filters on where and join. Only plugins that 2520 2520 // manipulate paging queries should use these hooks. 2521 2521 if ( !$q['suppress_filters'] ) { 2522 $where = apply_filters _ref_array( 'posts_where_paged', array( $where, &$this ));2523 $groupby = apply_filters _ref_array( 'posts_groupby', array( $groupby, &$this ));2524 $join = apply_filters _ref_array( 'posts_join_paged', array( $join, &$this ));2525 $orderby = apply_filters _ref_array( 'posts_orderby', array( $orderby, &$this ));2526 $distinct = apply_filters _ref_array( 'posts_distinct', array( $distinct, &$this ));2527 $limits = apply_filters _ref_array( 'post_limits', array( $limits, &$this ));2528 $fields = apply_filters _ref_array( 'posts_fields', array( $fields, &$this ));2522 $where = apply_filters( 'posts_where_paged', $where, $this ); 2523 $groupby = apply_filters( 'posts_groupby', $groupby, $this ); 2524 $join = apply_filters( 'posts_join_paged', $join, $this ); 2525 $orderby = apply_filters( 'posts_orderby', $orderby, $this ); 2526 $distinct = apply_filters( 'posts_distinct', $distinct, $this ); 2527 $limits = apply_filters( 'post_limits', $limits, $this ); 2528 $fields = apply_filters( 'posts_fields', $fields, $this ); 2529 2529 2530 2530 // Filter all clauses at once, for convenience 2531 $clauses = (array) apply_filters _ref_array( 'posts_clauses', array( compact( $pieces ), &$this ));2531 $clauses = (array) apply_filters( 'posts_clauses', compact( $pieces ), $this ); 2532 2532 foreach ( $pieces as $piece ) 2533 2533 $$piece = isset( $clauses[ $piece ] ) ? $clauses[ $piece ] : ''; 2534 2534 } … … 2538 2538 2539 2539 // Filter again for the benefit of caching plugins. Regular plugins should use the hooks above. 2540 2540 if ( !$q['suppress_filters'] ) { 2541 $where = apply_filters _ref_array( 'posts_where_request', array( $where, &$this ));2542 $groupby = apply_filters _ref_array( 'posts_groupby_request', array( $groupby, &$this ));2543 $join = apply_filters _ref_array( 'posts_join_request', array( $join, &$this ));2544 $orderby = apply_filters _ref_array( 'posts_orderby_request', array( $orderby, &$this ));2545 $distinct = apply_filters _ref_array( 'posts_distinct_request', array( $distinct, &$this ));2546 $fields = apply_filters _ref_array( 'posts_fields_request', array( $fields, &$this ));2547 $limits = apply_filters _ref_array( 'post_limits_request', array( $limits, &$this ));2541 $where = apply_filters( 'posts_where_request', $where, $this ); 2542 $groupby = apply_filters( 'posts_groupby_request', $groupby, $this ); 2543 $join = apply_filters( 'posts_join_request', $join, $this ); 2544 $orderby = apply_filters( 'posts_orderby_request', $orderby, $this ); 2545 $distinct = apply_filters( 'posts_distinct_request', $distinct, $this ); 2546 $fields = apply_filters( 'posts_fields_request', $fields, $this ); 2547 $limits = apply_filters( 'post_limits_request', $limits, $this ); 2548 2548 2549 2549 // Filter all clauses at once, for convenience 2550 $clauses = (array) apply_filters _ref_array( 'posts_clauses_request', array( compact( $pieces ), &$this ));2550 $clauses = (array) apply_filters( 'posts_clauses_request', compact( $pieces ), $this ); 2551 2551 foreach ( $pieces as $piece ) 2552 2552 $$piece = isset( $clauses[ $piece ] ) ? $clauses[ $piece ] : ''; 2553 2553 } … … 2563 2563 2564 2564 $this->request = " SELECT $found_rows $distinct $fields FROM $wpdb->posts $join WHERE 1=1 $where $groupby $orderby $limits"; 2565 2565 if ( !$q['suppress_filters'] ) 2566 $this->request = apply_filters _ref_array('posts_request', array( $this->request, &$this ));2566 $this->request = apply_filters('posts_request', $this->request, $this ); 2567 2567 2568 2568 if ( 'ids' == $q['fields'] ) { 2569 2569 $this->posts = $wpdb->get_col($this->request); … … 2585 2585 2586 2586 // Raw results filter. Prior to status checks. 2587 2587 if ( !$q['suppress_filters'] ) 2588 $this->posts = apply_filters _ref_array('posts_results', array( $this->posts, &$this ));2588 $this->posts = apply_filters('posts_results', $this->posts, $this ); 2589 2589 2590 2590 if ( !empty($this->posts) && $this->is_comment_feed && $this->is_singular ) { 2591 $cjoin = apply_filters _ref_array('comment_feed_join', array( '', &$this ));2592 $cwhere = apply_filters _ref_array('comment_feed_where', array( "WHERE comment_post_ID = '{$this->posts[0]->ID}' AND comment_approved = '1'", &$this ));2593 $cgroupby = apply_filters _ref_array('comment_feed_groupby', array( '', &$this ));2591 $cjoin = apply_filters('comment_feed_join', '', $this ); 2592 $cwhere = apply_filters('comment_feed_where', "WHERE comment_post_ID = '{$this->posts[0]->ID}' AND comment_approved = '1'", $this ); 2593 $cgroupby = apply_filters('comment_feed_groupby', '', $this ); 2594 2594 $cgroupby = ( ! empty( $cgroupby ) ) ? 'GROUP BY ' . $cgroupby : ''; 2595 $corderby = apply_filters _ref_array('comment_feed_orderby', array( 'comment_date_gmt DESC', &$this ));2595 $corderby = apply_filters('comment_feed_orderby', 'comment_date_gmt DESC', $this ); 2596 2596 $corderby = ( ! empty( $corderby ) ) ? 'ORDER BY ' . $corderby : ''; 2597 $climits = apply_filters _ref_array('comment_feed_limits', array( 'LIMIT ' . get_option('posts_per_rss'), &$this ));2597 $climits = apply_filters('comment_feed_limits', 'LIMIT ' . get_option('posts_per_rss'), $this ); 2598 2598 $comments_request = "SELECT $wpdb->comments.* FROM $wpdb->comments $cjoin $cwhere $cgroupby $corderby $climits"; 2599 2599 $this->comments = $wpdb->get_results($comments_request); 2600 2600 $this->comment_count = count($this->comments); 2601 2601 } 2602 2602 2603 2603 if ( !$q['no_found_rows'] && !empty($limits) ) { 2604 $found_posts_query = apply_filters _ref_array( 'found_posts_query', array( 'SELECT FOUND_ROWS()', &$this ));2604 $found_posts_query = apply_filters( 'found_posts_query', 'SELECT FOUND_ROWS()', $this ); 2605 2605 $this->found_posts = $wpdb->get_var( $found_posts_query ); 2606 $this->found_posts = apply_filters _ref_array( 'found_posts', array( $this->found_posts, &$this ));2606 $this->found_posts = apply_filters( 'found_posts', $this->found_posts, $this ); 2607 2607 $this->max_num_pages = ceil($this->found_posts / $q['posts_per_page']); 2608 2608 } 2609 2609 … … 2636 2636 } 2637 2637 2638 2638 if ( $this->is_preview && current_user_can( $edit_cap, $this->posts[0]->ID ) ) 2639 $this->posts[0] = apply_filters _ref_array('the_preview', array( $this->posts[0], &$this ));2639 $this->posts[0] = apply_filters('the_preview', $this->posts[0], $this ); 2640 2640 } 2641 2641 2642 2642 // Put sticky posts at the top of the posts array … … 2690 2690 } 2691 2691 2692 2692 if ( !$q['suppress_filters'] ) 2693 $this->posts = apply_filters _ref_array('the_posts', array( $this->posts, &$this ));2693 $this->posts = apply_filters('the_posts', $this->posts, $this ); 2694 2694 2695 2695 $this->post_count = count($this->posts); 2696 2696 … … 2734 2734 * @since 1.5.0 2735 2735 * @access public 2736 2736 * @uses $post 2737 * @uses do_action _ref_array() Calls 'loop_start' if loop has just started2737 * @uses do_action() Calls 'loop_start' if loop has just started 2738 2738 */ 2739 2739 function the_post() { 2740 2740 global $post; 2741 2741 $this->in_the_loop = true; 2742 2742 2743 2743 if ( $this->current_post == -1 ) // loop has just started 2744 do_action _ref_array('loop_start', array(&$this));2744 do_action( 'loop_start', $this ); 2745 2745 2746 2746 $post = $this->next_post(); 2747 2747 setup_postdata($post); … … 2754 2754 * 2755 2755 * @since 1.5.0 2756 2756 * @access public 2757 * @uses do_action _ref_array() Calls 'loop_end' if loop is ended2757 * @uses do_action() Calls 'loop_end' if loop is ended 2758 2758 * 2759 2759 * @return bool True if posts are available, false if end of loop. 2760 2760 */ … … 2762 2762 if ( $this->current_post + 1 < $this->post_count ) { 2763 2763 return true; 2764 2764 } elseif ( $this->current_post + 1 == $this->post_count && $this->post_count > 0 ) { 2765 do_action _ref_array('loop_end', array(&$this));2765 do_action( 'loop_end', $this ); 2766 2766 // Do some cleaning up after the loop 2767 2767 $this->rewind_posts(); 2768 2768 } … … 3487 3487 * @since 1.5.0 3488 3488 * 3489 3489 * @param object $post Post data. 3490 * @uses do_action _ref_array() Calls 'the_post'3490 * @uses do_action() Calls 'the_post' 3491 3491 * @return bool True when finished. 3492 3492 */ 3493 3493 function setup_postdata($post) { … … 3520 3520 $multipage = 0; 3521 3521 } 3522 3522 3523 do_action _ref_array('the_post', array(&$post));3523 do_action( 'the_post', $post ); 3524 3524 3525 3525 return true; 3526 3526 } -
wp-includes/rewrite.php
1562 1562 else 1563 1563 $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); 1564 1564 1565 do_action _ref_array('generate_rewrite_rules', array(&$this));1565 do_action( 'generate_rewrite_rules', $this ); 1566 1566 $this->rules = apply_filters('rewrite_rules_array', $this->rules); 1567 1567 1568 1568 return $this->rules; -
wp-includes/script-loader.php
46 46 * 47 47 * @param object $scripts WP_Scripts object. 48 48 */ 49 function wp_default_scripts( &$scripts ) {49 function wp_default_scripts( $scripts ) { 50 50 51 51 if ( !$guessurl = site_url() ) 52 52 $guessurl = wp_guess_url(); … … 453 453 * 454 454 * @param object $styles 455 455 */ 456 function wp_default_styles( &$styles ) {456 function wp_default_styles( $styles ) { 457 457 // This checks to see if site_url() returns something and if it does not 458 458 // then it assigns $guess_url to wp_guess_url(). Strange format, but it works. 459 459 if ( ! $guessurl = site_url() ) -
wp-includes/taxonomy.php
1120 1120 1121 1121 foreach ( $taxonomies as $taxonomy ) { 1122 1122 if ( ! taxonomy_exists($taxonomy) ) { 1123 $error = &new WP_Error('invalid_taxonomy', __('Invalid Taxonomy'));1123 $error = new WP_Error('invalid_taxonomy', __('Invalid Taxonomy')); 1124 1124 return $error; 1125 1125 } 1126 1126 } -
wp-includes/theme.php
1476 1476 1477 1477 require_once( ABSPATH . 'wp-admin/custom-header.php' ); 1478 1478 $custom_image_header = new Custom_Image_Header( $admin_header_callback, $admin_image_div_callback ); 1479 add_action( 'admin_menu', array( &$custom_image_header, 'init' ) );1479 add_action( 'admin_menu', array( $custom_image_header, 'init' ) ); 1480 1480 } 1481 1481 1482 1482 /** … … 1497 1497 remove_theme_support( 'custom-header-uploads' ); 1498 1498 1499 1499 if ( is_admin() ) { 1500 remove_action( 'admin_menu', array( &$GLOBALS['custom_image_header'], 'init' ) );1500 remove_action( 'admin_menu', array( $GLOBALS['custom_image_header'], 'init' ) ); 1501 1501 unset( $GLOBALS['custom_image_header'] ); 1502 1502 } 1503 1503 … … 1615 1615 if ( ! is_admin() ) 1616 1616 return; 1617 1617 require_once( ABSPATH . 'wp-admin/custom-background.php' ); 1618 $GLOBALS['custom_background'] = &new Custom_Background( $admin_header_callback, $admin_image_div_callback );1619 add_action( 'admin_menu', array( &$GLOBALS['custom_background'], 'init' ) );1618 $GLOBALS['custom_background'] = new Custom_Background( $admin_header_callback, $admin_image_div_callback ); 1619 add_action( 'admin_menu', array( $GLOBALS['custom_background'], 'init' ) ); 1620 1620 } 1621 1621 1622 1622 /** … … 1636 1636 _remove_theme_support( 'custom-background' ); 1637 1637 1638 1638 if ( is_admin() ) { 1639 remove_action( 'admin_menu', array( &$GLOBALS['custom_background'], 'init' ) );1639 remove_action( 'admin_menu', array( $GLOBALS['custom_background'], 'init' ) ); 1640 1640 unset( $GLOBALS['custom_background'] ); 1641 1641 } 1642 1642 -
wp-includes/user.php
518 518 } 519 519 520 520 if ( !empty( $qv['meta_query'] ) ) { 521 $clauses = call_user_func_array( '_get_meta_sql', array( $qv['meta_query'], 'user', $wpdb->users, 'ID', &$this ) );521 $clauses = call_user_func_array( '_get_meta_sql', array( $qv['meta_query'], 'user', $wpdb->users, 'ID', $this ) ); 522 522 $this->query_from .= $clauses['join']; 523 523 $this->query_where .= $clauses['where']; 524 524 } … … 531 531 $this->query_where .= " AND $wpdb->users.ID NOT IN ($ids)"; 532 532 } 533 533 534 do_action _ref_array( 'pre_user_query', array( &$this ));534 do_action( 'pre_user_query', $this ); 535 535 } 536 536 537 537 /** … … 1052 1052 * 1053 1053 * @param object $user The user data object. 1054 1054 */ 1055 function _fill_user( &$user ) {1055 function _fill_user( $user ) { 1056 1056 $metavalues = get_user_metavalues(array($user->ID)); 1057 1057 _fill_single_user($user, $metavalues[$user->ID]); 1058 1058 } … … 1091 1091 * @param object $user The User object. 1092 1092 * @param array $metavalues An array of objects provided by get_user_metavalues() 1093 1093 */ 1094 function _fill_single_user( &$user, &$metavalues ) {1094 function _fill_single_user( $user, $metavalues ) { 1095 1095 global $wpdb; 1096 1096 1097 1097 foreach ( $metavalues as $meta ) { … … 1122 1122 * @since 3.0.0 1123 1123 * @param array $users User objects 1124 1124 */ 1125 function _fill_many_users( &$users ) {1125 function _fill_many_users( $users ) { 1126 1126 $ids = array(); 1127 1127 foreach( $users as $user_object ) { 1128 1128 $ids[] = $user_object->ID; … … 1260 1260 * 1261 1261 * @param object $user User object to be cached 1262 1262 */ 1263 function update_user_caches( &$user) {1263 function update_user_caches($user) { 1264 1264 wp_cache_add($user->ID, $user, 'users'); 1265 1265 wp_cache_add($user->user_login, $user->ID, 'userlogins'); 1266 1266 wp_cache_add($user->user_email, $user->ID, 'useremail'); -
wp-includes/widgets.php
152 152 } 153 153 154 154 function _get_display_callback() { 155 return array( &$this, 'display_callback');155 return array($this, 'display_callback'); 156 156 } 157 157 158 158 function _get_update_callback() { 159 return array( &$this, 'update_callback');159 return array($this, 'update_callback'); 160 160 } 161 161 162 162 function _get_form_callback() { 163 return array( &$this, 'form_callback');163 return array($this, 'form_callback'); 164 164 } 165 165 166 166 /** Generate the actual widget content. … … 270 270 $return = $this->form($instance); 271 271 // add extra fields in the widget form - be sure to set $return to null if you add any 272 272 // 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) ); 274 274 } 275 275 return $return; 276 276 } … … 317 317 var $widgets = array(); 318 318 319 319 function WP_Widget_Factory() { 320 add_action( 'widgets_init', array( &$this, '_register_widgets' ), 100 );320 add_action( 'widgets_init', array( $this, '_register_widgets' ), 100 ); 321 321 } 322 322 323 323 function register($widget_class) { 324 $this->widgets[$widget_class] = &new $widget_class();324 $this->widgets[$widget_class] = new $widget_class(); 325 325 } 326 326 327 327 function unregister($widget_class) { -
wp-includes/wp-db.php
494 494 * @param string $dbhost MySQL database host 495 495 */ 496 496 function __construct( $dbuser, $dbpassword, $dbname, $dbhost ) { 497 register_shutdown_function( array( &$this, '__destruct' ) );497 register_shutdown_function( array( $this, '__destruct' ) ); 498 498 499 499 if ( WP_DEBUG ) 500 500 $this->show_errors(); … … 903 903 $query = str_replace( "'%s'", '%s', $query ); // in case someone mistakenly already singlequoted it 904 904 $query = str_replace( '"%s"', '%s', $query ); // doublequote unquoting 905 905 $query = preg_replace( '|(?<!%)%s|', "'%s'", $query ); // quote the strings, avoiding escaped strings like %%s 906 array_walk( $args, array( &$this, 'escape_by_ref' ) );906 array_walk( $args, array( $this, 'escape_by_ref' ) ); 907 907 return @vsprintf( $query, $args ); 908 908 } 909 909 -
wp-includes/wp-diff.php
426 426 $chars2 = count_chars($string2); 427 427 428 428 // L1-norm of difference vector. 429 $difference = array_sum( array_map( array( &$this, 'difference'), $chars1, $chars2 ) );429 $difference = array_sum( array_map( array($this, 'difference'), $chars1, $chars2 ) ); 430 430 431 431 // $string1 has zero length? Odd. Give huge penalty by not dividing. 432 432 if ( !$string1 ) -
wp-app.php
299 299 } 300 300 301 301 array_shift($matches); 302 call_user_func_array(array( &$this,$funcs[$method]), $matches);302 call_user_func_array(array($this,$funcs[$method]), $matches); 303 303 exit(); 304 304 } else { 305 305 // only allow what we have handlers for... -
wp-settings.php
216 216 * @global object $wp_the_query 217 217 * @since 2.0.0 218 218 */ 219 $wp_the_query = &new WP_Query();219 $wp_the_query = new WP_Query(); 220 220 221 221 /** 222 222 * Holds the reference to @see $wp_the_query … … 231 231 * @global object $wp_rewrite 232 232 * @since 1.5.0 233 233 */ 234 $wp_rewrite = &new WP_Rewrite();234 $wp_rewrite = new WP_Rewrite(); 235 235 236 236 /** 237 237 * WordPress Object 238 238 * @global object $wp 239 239 * @since 2.0.0 240 240 */ 241 $wp = &new WP();241 $wp = new WP(); 242 242 243 243 /** 244 244 * WordPress Widget Factory Object 245 245 * @global object $wp_widget_factory 246 246 * @since 2.8.0 247 247 */ 248 $wp_widget_factory = &new WP_Widget_Factory();248 $wp_widget_factory = new WP_Widget_Factory(); 249 249 250 250 do_action( 'setup_theme' ); 251 251 … … 270 270 * @global object $wp_locale 271 271 * @since 2.1.0 272 272 */ 273 $wp_locale = &new WP_Locale();273 $wp_locale = new WP_Locale(); 274 274 275 275 // Load the functions for the active theme, for both parent and child theme if applicable. 276 276 if ( TEMPLATEPATH !== STYLESHEETPATH && file_exists( STYLESHEETPATH . '/functions.php' ) )