If posts is an empty array, bail from set_found_posts(). If posts is null or otherwise empty proceed through set_found_posts(). This accommodates caching plugins such as Advanced Post Cache that force posts to be empty for later population but still require the found_posts_query filter to run.
fixes #14426 git-svn-id: https://develop.svn.wordpress.org/trunk@22258 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
4cb0404e13
commit
361ecbb452
@ -2799,7 +2799,9 @@ class WP_Query {
|
||||
function set_found_posts( $q, $limits ) {
|
||||
global $wpdb;
|
||||
|
||||
if ( $q['no_found_rows'] || ! $this->posts )
|
||||
// Bail if posts is an empty array. Continue if posts is an empty string
|
||||
// null, or false to accommodate caching plugins that fill posts later.
|
||||
if ( $q['no_found_rows'] || ( is_array( $this->posts ) && ! $this->posts ) )
|
||||
return;
|
||||
|
||||
if ( ! empty( $limits ) )
|
||||
|
Loading…
Reference in New Issue
Block a user