From 97aff78b06ef8a6351388605f48ae8592f23101e Mon Sep 17 00:00:00 2001 From: ryan Date: Wed, 9 May 2012 17:20:22 +0000 Subject: [PATCH] Set split_the_query to false if more than 500 rows requested. Props SergeyBiryukov. fixes #20628 git-svn-id: http://core.svn.wordpress.org/trunk@20756 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/query.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/wp-includes/query.php b/wp-includes/query.php index 3cb2384a8a..bd511182cb 100644 --- a/wp-includes/query.php +++ b/wp-includes/query.php @@ -2626,7 +2626,8 @@ class WP_Query { return $r; } - $split_the_query = apply_filters( 'split_the_query', ( $old_request == $this->request && "$wpdb->posts.*" == $fields && !empty( $limits) ), $this ); + $split_the_query = ( $old_request == $this->request && "$wpdb->posts.*" == $fields && !empty( $limits ) && $q['posts_per_page'] < 500 ); + $split_the_query = apply_filters( 'split_the_query', $split_the_query, $this ); if ( $split_the_query ) { // First get the IDs and then fill in the objects