diff --git a/src/wp-includes/class-wp-query.php b/src/wp-includes/class-wp-query.php
index bdfce5e52c..3cc337933a 100644
a
|
b
|
class WP_Query { |
3269 | 3269 | } |
3270 | 3270 | |
3271 | 3271 | if ( null === $this->posts ) { |
3272 | | $split_the_query = ( $old_request == $this->request && "{$wpdb->posts}.*" === $fields && ! empty( $limits ) && $q['posts_per_page'] < 500 ); |
| 3272 | if ( $q['posts_per_page'] == 1 ) { |
| 3273 | $split_the_query = false; |
| 3274 | } |
| 3275 | else { |
| 3276 | $split_the_query = ( $old_request == $this->request && "{$wpdb->posts}.*" === $fields && ! empty( $limits ) && $q['posts_per_page'] < 500 ); |
3273 | 3277 | |
3274 | | /** |
3275 | | * Filters whether to split the query. |
3276 | | * |
3277 | | * Splitting the query will cause it to fetch just the IDs of the found posts |
3278 | | * (and then individually fetch each post by ID), rather than fetching every |
3279 | | * complete row at once. One massive result vs. many small results. |
3280 | | * |
3281 | | * @since 3.4.0 |
3282 | | * |
3283 | | * @param bool $split_the_query Whether or not to split the query. |
3284 | | * @param WP_Query $query The WP_Query instance. |
3285 | | */ |
3286 | | $split_the_query = apply_filters( 'split_the_query', $split_the_query, $this ); |
| 3278 | /** |
| 3279 | * Filters whether to split the query. |
| 3280 | * |
| 3281 | * Splitting the query will cause it to fetch just the IDs of the found posts |
| 3282 | * (and then individually fetch each post by ID), rather than fetching every |
| 3283 | * complete row at once. One massive result vs. many small results. |
| 3284 | * |
| 3285 | * @since 3.4.0 |
| 3286 | * |
| 3287 | * @param bool $split_the_query Whether or not to split the query. |
| 3288 | * @param WP_Query $query The WP_Query instance. |
| 3289 | */ |
| 3290 | $split_the_query = apply_filters( 'split_the_query', $split_the_query, $this ); |
| 3291 | } |
| 3292 | |
3287 | 3293 | |
3288 | 3294 | if ( $split_the_query ) { |
3289 | 3295 | // First get the IDs and then fill in the objects. |