Changeset 13758
- Timestamp:
- 03/18/2010 09:55:25 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/query.php
r13733 r13758 1807 1807 } 1808 1808 } 1809 $search = apply_filters ('posts_search', $search, $this);1809 $search = apply_filters_ref_array('posts_search', array( $search, &$this ) ); 1810 1810 1811 1811 // Category stuff … … 2244 2244 // manipulations to them are reflected in the paging by day queries. 2245 2245 if ( !$q['suppress_filters'] ) { 2246 $where = apply_filters ('posts_where', $where);2247 $join = apply_filters ('posts_join', $join);2246 $where = apply_filters_ref_array('posts_where', array( $where, &$this ) ); 2247 $join = apply_filters_ref_array('posts_join', array( $join, &$this ) ); 2248 2248 } 2249 2249 … … 2279 2279 2280 2280 if ( !$q['suppress_filters'] ) { 2281 $cjoin = apply_filters ('comment_feed_join', $cjoin);2282 $cwhere = apply_filters ('comment_feed_where', $cwhere);2283 $cgroupby = apply_filters ('comment_feed_groupby', $cgroupby);2284 $corderby = apply_filters ('comment_feed_orderby', 'comment_date_gmt DESC');2285 $climits = apply_filters ('comment_feed_limits', 'LIMIT ' . get_option('posts_per_rss'));2281 $cjoin = apply_filters_ref_array('comment_feed_join', array( $cjoin, &$this ) ); 2282 $cwhere = apply_filters_ref_array('comment_feed_where', array( $cwhere, &$this ) ); 2283 $cgroupby = apply_filters_ref_array('comment_feed_groupby', array( $cgroupby, &$this ) ); 2284 $corderby = apply_filters_ref_array('comment_feed_orderby', array( 'comment_date_gmt DESC', &$this ) ); 2285 $climits = apply_filters_ref_array('comment_feed_limits', array( 'LIMIT ' . get_option('posts_per_rss'), &$this ) ); 2286 2286 } 2287 2287 $cgroupby = ( ! empty( $cgroupby ) ) ? 'GROUP BY ' . $cgroupby : ''; … … 2309 2309 // manipulate paging queries should use these hooks. 2310 2310 if ( !$q['suppress_filters'] ) { 2311 $where = apply_filters('posts_where_paged', $where); 2312 $groupby = apply_filters('posts_groupby', $groupby); 2313 $join = apply_filters('posts_join_paged', $join); 2314 $orderby = apply_filters('posts_orderby', $orderby); 2315 $distinct = apply_filters('posts_distinct', $distinct); 2316 $limits = apply_filters( 'post_limits', $limits ); 2317 2318 $fields = apply_filters('posts_fields', $fields); 2311 $where = apply_filters_ref_array( 'posts_where_paged', array( $where, &$this ) ); 2312 $groupby = apply_filters_ref_array( 'posts_groupby', array( $groupby, &$this ) ); 2313 $join = apply_filters_ref_array( 'posts_join_paged', array( $join, &$this ) ); 2314 $orderby = apply_filters_ref_array( 'posts_orderby', array( $orderby, &$this ) ); 2315 $distinct = apply_filters_ref_array( 'posts_distinct', array( $distinct, &$this ) ); 2316 $limits = apply_filters_ref_array( 'post_limits', array( $limits, &$this ) ); 2317 $fields = apply_filters_ref_array( 'posts_fields', array( $fields, &$this ) ); 2319 2318 } 2320 2319 … … 2324 2323 // Filter again for the benefit of caching plugins. Regular plugins should use the hooks above. 2325 2324 if ( !$q['suppress_filters'] ) { 2326 $where = apply_filters('posts_where_request', $where);2327 $groupby = apply_filters('posts_groupby_request', $groupby);2328 $join = apply_filters('posts_join_request', $join);2329 $orderby = apply_filters('posts_orderby_request', $orderby);2330 $distinct = apply_filters('posts_distinct_request', $distinct);2331 $fields = apply_filters('posts_fields_request', $fields);2332 $limits = apply_filters( 'post_limits_request', $limits);2325 $where = apply_filters_ref_array( 'posts_where_request', array( $where, &$this ) ); 2326 $groupby = apply_filters_ref_array( 'posts_groupby_request', array( $groupby, &$this ) ); 2327 $join = apply_filters_ref_array( 'posts_join_request', array( $join, &$this ) ); 2328 $orderby = apply_filters_ref_array( 'posts_orderby_request', array( $orderby, &$this ) ); 2329 $distinct = apply_filters_ref_array( 'posts_distinct_request', array( $distinct, &$this ) ); 2330 $fields = apply_filters_ref_array( 'posts_fields_request', array( $fields, &$this ) ); 2331 $limits = apply_filters_ref_array( 'post_limits_request', array( $limits, &$this ) ); 2333 2332 } 2334 2333 … … 2343 2342 $this->request = " SELECT $found_rows $distinct $fields FROM $wpdb->posts $join WHERE 1=1 $where $groupby $orderby $limits"; 2344 2343 if ( !$q['suppress_filters'] ) 2345 $this->request = apply_filters ('posts_request', $this->request);2344 $this->request = apply_filters_ref_array('posts_request', array( $this->request, &$this ) ); 2346 2345 2347 2346 $this->posts = $wpdb->get_results($this->request); 2348 2347 // Raw results filter. Prior to status checks. 2349 2348 if ( !$q['suppress_filters'] ) 2350 $this->posts = apply_filters ('posts_results', $this->posts);2349 $this->posts = apply_filters_ref_array('posts_results', array( $this->posts, &$this ) ); 2351 2350 2352 2351 if ( !empty($this->posts) && $this->is_comment_feed && $this->is_singular ) { 2353 $cjoin = apply_filters ('comment_feed_join', '');2354 $cwhere = apply_filters ('comment_feed_where', "WHERE comment_post_ID = '{$this->posts[0]->ID}' AND comment_approved = '1'");2355 $cgroupby = apply_filters ('comment_feed_groupby', '');2352 $cjoin = apply_filters_ref_array('comment_feed_join', array( '', &$this ) ); 2353 $cwhere = apply_filters_ref_array('comment_feed_where', array( "WHERE comment_post_ID = '{$this->posts[0]->ID}' AND comment_approved = '1'", &$this ) ); 2354 $cgroupby = apply_filters_ref_array('comment_feed_groupby', array( '', &$this ) ); 2356 2355 $cgroupby = ( ! empty( $cgroupby ) ) ? 'GROUP BY ' . $cgroupby : ''; 2357 $corderby = apply_filters ('comment_feed_orderby', 'comment_date_gmt DESC');2356 $corderby = apply_filters_ref_array('comment_feed_orderby', array( 'comment_date_gmt DESC', &$this ) ); 2358 2357 $corderby = ( ! empty( $corderby ) ) ? 'ORDER BY ' . $corderby : ''; 2359 $climits = apply_filters ('comment_feed_limits', 'LIMIT ' . get_option('posts_per_rss'));2358 $climits = apply_filters_ref_array('comment_feed_limits', array( 'LIMIT ' . get_option('posts_per_rss'), &$this ) ); 2360 2359 $comments_request = "SELECT $wpdb->comments.* FROM $wpdb->comments $cjoin $cwhere $cgroupby $corderby $climits"; 2361 2360 $this->comments = $wpdb->get_results($comments_request); … … 2364 2363 2365 2364 if ( !$q['no_found_rows'] && !empty($limits) ) { 2366 $found_posts_query = apply_filters ( 'found_posts_query', 'SELECT FOUND_ROWS()');2365 $found_posts_query = apply_filters_ref_array( 'found_posts_query', array( 'SELECT FOUND_ROWS()', &$this ) ); 2367 2366 $this->found_posts = $wpdb->get_var( $found_posts_query ); 2368 $this->found_posts = apply_filters ( 'found_posts', $this->found_posts);2367 $this->found_posts = apply_filters_ref_array( 'found_posts', array( $this->found_posts, &$this ) ); 2369 2368 $this->max_num_pages = ceil($this->found_posts / $q['posts_per_page']); 2370 2369 } … … 2399 2398 2400 2399 if ( $this->is_preview && current_user_can( $edit_cap, $this->posts[0]->ID ) ) 2401 $this->posts[0] = apply_filters ('the_preview', $this->posts[0]);2400 $this->posts[0] = apply_filters_ref_array('the_preview', array( $this->posts[0], &$this )); 2402 2401 } 2403 2402 … … 2448 2447 2449 2448 if ( !$q['suppress_filters'] ) 2450 $this->posts = apply_filters ('the_posts', $this->posts);2449 $this->posts = apply_filters_ref_array('the_posts', array( $this->posts, &$this ) ); 2451 2450 2452 2451 $this->post_count = count($this->posts);
Note: See TracChangeset
for help on using the changeset viewer.