Ticket #14997: wp_query_bits.diff
File wp_query_bits.diff, 3.0 KB (added by , 15 years ago) |
---|
-
wp-includes/query.php
2257 2257 // Apply post-paging filters on where and join. Only plugins that 2258 2258 // manipulate paging queries should use these hooks. 2259 2259 if ( !$q['suppress_filters'] ) { 2260 $distinct = apply_filters_ref_array( 'posts_distinct', array( $distinct, &$this ) ); 2261 $fields = apply_filters_ref_array( 'posts_fields', array( $fields, &$this ) ); 2260 2262 $where = apply_filters_ref_array( 'posts_where_paged', array( $where, &$this ) ); 2263 $join = apply_filters_ref_array( 'posts_join_paged', array( $join, &$this ) ); 2261 2264 $groupby = apply_filters_ref_array( 'posts_groupby', array( $groupby, &$this ) ); 2262 $join = apply_filters_ref_array( 'posts_join_paged', array( $join, &$this ) );2263 2265 $orderby = apply_filters_ref_array( 'posts_orderby', array( $orderby, &$this ) ); 2264 $distinct = apply_filters_ref_array( 'posts_distinct', array( $distinct, &$this ) ); 2265 $limits = apply_filters_ref_array( 'post_limits', array( $limits, &$this ) ); 2266 $fields = apply_filters_ref_array( 'posts_fields', array( $fields, &$this ) ); 2266 $limits = apply_filters_ref_array( 'post_limits', array( $limits, &$this ) ); 2267 2267 } 2268 2268 2269 $bits = array(); 2270 foreach ( array('distinct', 'fields', 'where', 'join', 'groupby', 'orderby', 'limits') as $var ) { 2271 $bits[ $var ] = $$var; 2272 unset( $$var ); // so we can use EXTR_SKIP below 2273 } 2274 2275 $bits = apply_filters_ref_array( 'wp_query_bits', array( $bits, &$this ) ); 2276 2277 extract( $bits, EXTR_SKIP ); 2278 2269 2279 // Announce current selection parameters. For use by caching plugins. 2270 2280 do_action( 'posts_selection', $where . $groupby . $orderby . $limits . $join ); 2271 2281 2272 2282 // Filter again for the benefit of caching plugins. Regular plugins should use the hooks above. 2273 2283 if ( !$q['suppress_filters'] ) { 2284 $distinct = apply_filters_ref_array( 'posts_distinct_request',array( $distinct, &$this ) ); 2285 $fields = apply_filters_ref_array( 'posts_fields_request', array( $fields, &$this ) ); 2274 2286 $where = apply_filters_ref_array( 'posts_where_request', array( $where, &$this ) ); 2275 $groupby = apply_filters_ref_array( 'posts_groupby_request', array( $groupby, &$this ) );2276 2287 $join = apply_filters_ref_array( 'posts_join_request', array( $join, &$this ) ); 2277 $orderby = apply_filters_ref_array( 'posts_orderby_request', array( $orderby, &$this ) ); 2278 $distinct = apply_filters_ref_array( 'posts_distinct_request', array( $distinct, &$this ) ); 2279 $fields = apply_filters_ref_array( 'posts_fields_request', array( $fields, &$this ) ); 2280 $limits = apply_filters_ref_array( 'post_limits_request', array( $limits, &$this ) ); 2288 $groupby = apply_filters_ref_array( 'posts_groupby_request', array( $groupby, &$this ) ); 2289 $orderby = apply_filters_ref_array( 'posts_orderby_request', array( $orderby, &$this ) ); 2290 $limits = apply_filters_ref_array( 'post_limits_request', array( $limits, &$this ) ); 2281 2291 } 2282 2292 2283 2293 if ( ! empty($groupby) )