Index: taxonomy.php
===================================================================
--- taxonomy.php	(revision 15689)
+++ taxonomy.php	(working copy)
@@ -1098,6 +1098,24 @@
 	}
 	$select_this = implode(', ', apply_filters( 'get_terms_fields', $selects, $args ));
 
+	// Apply post-paging filters on where and join.  Only plugins that
+	// manipulate paging queries should use these hooks.
+	$in_taxonomies	= apply_filters( 'terms_in_taxonomies',	$in_taxonomies, $args);
+	$where			= apply_filters( 'terms_where',		$where, $args);
+	$orderby		= apply_filters( 'terms_orderby',	$orderby, $args);
+	$order			= apply_filters( 'terms_order',		$order, $args);
+	$limit			= apply_filters( 'terms_limit',		$limit, $args);
+
+	// Announce current selection parameters.  For use by caching plugins.
+	do_action( 'terms_selection', $in_taxonomies . $where . $orderby . $order . $limit );
+
+	// Filter again for the benefit of caching plugins.  Regular plugins should use the hooks above.
+	$in_taxonomies	= apply_filters( 'terms_in_taxonomies_request',	$in_taxonomies, $args);
+	$where			= apply_filters( 'terms_where_request',		$where, $args);
+	$orderby		= apply_filters( 'terms_orderby_request',	$orderby, $args);
+	$order			= apply_filters( 'terms_order_request',		$order, $args);
+	$limit			= apply_filters( 'terms_limit_request',		$limit, $args);
+
 	$query = "SELECT $select_this FROM $wpdb->terms AS t INNER JOIN $wpdb->term_taxonomy AS tt ON t.term_id = tt.term_id WHERE tt.taxonomy IN ($in_taxonomies) $where $orderby $order $limit";
 
 	if ( 'count' == $fields ) {
