diff options
author | donncha <donncha@7be80a69-a1ef-0310-a953-fb0f7c49ff36> | 2006-12-01 12:27:29 +0000 |
---|---|---|
committer | donncha <donncha@7be80a69-a1ef-0310-a953-fb0f7c49ff36> | 2006-12-01 12:27:29 +0000 |
commit | aae5b160f307adf0703ae8f7c2b158b91570ec95 (patch) | |
tree | ba0d1eee6e2eedfe3fd0a693d773162ab9dc8a67 /wp-includes/query.php | |
parent | 9415bbca12c01c39da58e0ed2c4e6b44ff833e5d (diff) | |
download | wordpress-mu-aae5b160f307adf0703ae8f7c2b158b91570ec95.tar.gz wordpress-mu-aae5b160f307adf0703ae8f7c2b158b91570ec95.tar.xz wordpress-mu-aae5b160f307adf0703ae8f7c2b158b91570ec95.zip |
WP Merge to 4578, except for script-loader
git-svn-id: http://svn.automattic.com/wordpress-mu/trunk@817 7be80a69-a1ef-0310-a953-fb0f7c49ff36
Diffstat (limited to 'wp-includes/query.php')
-rw-r--r-- | wp-includes/query.php | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/wp-includes/query.php b/wp-includes/query.php index 337e149..c04f378 100644 --- a/wp-includes/query.php +++ b/wp-includes/query.php @@ -971,15 +971,19 @@ class WP_Query { $orderby = apply_filters('posts_orderby', $q['orderby']);
$distinct = apply_filters('posts_distinct', $distinct);
$fields = apply_filters('posts_fields', "$wpdb->posts.*");
+ $limits = apply_filters( 'post_limits', $limits );
$found_rows = '';
if ( !empty($limits) )
$found_rows = 'SQL_CALC_FOUND_ROWS';
+
$request = " SELECT $found_rows $distinct $fields FROM $wpdb->posts $join WHERE 1=1 $where $groupby ORDER BY $orderby $limits";
$this->request = apply_filters('posts_request', $request);
$this->posts = $wpdb->get_results($this->request);
if ( !empty($limits) ) {
- $this->found_posts = $wpdb->get_var('SELECT FOUND_ROWS()');
+ $found_posts_query = apply_filters( 'found_posts_query', 'SELECT FOUND_ROWS()' );
+ $this->found_posts = $wpdb->get_var( $found_posts_query );
+ $this->found_posts = apply_filters( 'found_posts', $this->found_posts );
$this->max_num_pages = ceil($this->found_posts / $q['posts_per_page']);
}
// Check post status to determine if post should be displayed.
|