Index: wp-includes/query.php
===================================================================
--- wp-includes/query.php	(revision 15674)
+++ wp-includes/query.php	(working copy)
@@ -2257,27 +2257,37 @@
 		// Apply post-paging filters on where and join.  Only plugins that
 		// manipulate paging queries should use these hooks.
 		if ( !$q['suppress_filters'] ) {
+			$distinct	= apply_filters_ref_array( 'posts_distinct',	array( $distinct, &$this ) );
+			$fields		= apply_filters_ref_array( 'posts_fields',		array( $fields, &$this ) );
 			$where		= apply_filters_ref_array( 'posts_where_paged',	array( $where, &$this ) );
+			$join		= apply_filters_ref_array( 'posts_join_paged',	array( $join, &$this ) );
 			$groupby	= apply_filters_ref_array( 'posts_groupby',		array( $groupby, &$this ) );
-			$join		= apply_filters_ref_array( 'posts_join_paged',	array( $join, &$this ) );
 			$orderby	= apply_filters_ref_array( 'posts_orderby',		array( $orderby, &$this ) );
-			$distinct	= apply_filters_ref_array( 'posts_distinct',	array( $distinct, &$this ) );
-			$limits		= apply_filters_ref_array( 'post_limits',		array( $limits, &$this ) );
-			$fields		= apply_filters_ref_array( 'posts_fields',		array( $fields, &$this ) );
+			$limits		= apply_filters_ref_array( 'post_limits',		array( $limits, &$this ) );	
 		}
 
+		$bits = array();
+		foreach ( array('distinct', 'fields', 'where', 'join', 'groupby', 'orderby', 'limits') as $var ) {
+			$bits[ $var ] = $$var;
+			unset( $$var );	// so we can use EXTR_SKIP below
+		}
+
+		$bits = apply_filters_ref_array( 'wp_query_bits', array( $bits, &$this ) );
+
+		extract( $bits, EXTR_SKIP );
+
 		// Announce current selection parameters.  For use by caching plugins.
 		do_action( 'posts_selection', $where . $groupby . $orderby . $limits . $join );
 
 		// Filter again for the benefit of caching plugins.  Regular plugins should use the hooks above.
 		if ( !$q['suppress_filters'] ) {
+			$distinct	= apply_filters_ref_array( 'posts_distinct_request',array( $distinct, &$this ) );
+			$fields		= apply_filters_ref_array( 'posts_fields_request',	array( $fields, &$this ) );
 			$where		= apply_filters_ref_array( 'posts_where_request',	array( $where, &$this ) );
-			$groupby	= apply_filters_ref_array( 'posts_groupby_request',		array( $groupby, &$this ) );
 			$join		= apply_filters_ref_array( 'posts_join_request',	array( $join, &$this ) );
-			$orderby	= apply_filters_ref_array( 'posts_orderby_request',		array( $orderby, &$this ) );
-			$distinct	= apply_filters_ref_array( 'posts_distinct_request',	array( $distinct, &$this ) );
-			$fields		= apply_filters_ref_array( 'posts_fields_request',		array( $fields, &$this ) );
-			$limits		= apply_filters_ref_array( 'post_limits_request',		array( $limits, &$this ) );
+			$groupby	= apply_filters_ref_array( 'posts_groupby_request',	array( $groupby, &$this ) );
+			$orderby	= apply_filters_ref_array( 'posts_orderby_request',	array( $orderby, &$this ) );
+			$limits		= apply_filters_ref_array( 'post_limits_request',	array( $limits, &$this ) );
 		}
 
 		if ( ! empty($groupby) )
