Ticket #16661: 16661.3.patch
File 16661.3.patch, 18.7 KB (added by , 14 years ago) |
---|
-
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/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-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/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 /** -
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
221 221 ); 222 222 223 223 $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 ); 225 225 extract( $this->query_vars, EXTR_SKIP ); 226 226 227 227 // $args can be whatever, only use the args defined in defaults to compute the key … … 320 320 $where .= $this->get_search_sql( $search, array( 'comment_author', 'comment_author_email', 'comment_author_url', 'comment_author_IP', 'comment_content' ) ); 321 321 322 322 $pieces = array( 'fields', 'join', 'where', 'orderby', 'order', 'limits' ); 323 $clauses = apply_filters _ref_array( 'comments_clauses', array( compact( $pieces ), &$this ));323 $clauses = apply_filters( 'comments_clauses', compact( $pieces ), $this ); 324 324 foreach ( $pieces as $piece ) 325 325 $$piece = isset( $clauses[ $piece ] ) ? $clauses[ $piece ] : ''; 326 326 … … 330 330 return $wpdb->get_var( $query ); 331 331 332 332 $comments = $wpdb->get_results( $query ); 333 $comments = apply_filters _ref_array( 'the_comments', array( $comments, &$this ));333 $comments = apply_filters( 'the_comments', $comments, $this ); 334 334 335 335 wp_cache_add( $cache_key, $comments, 'comment' ); 336 336 -
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/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/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(); -
wp-includes/query.php
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 ) { … … 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/user.php
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 /** -
wp-includes/widgets.php
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 }