Make WordPress Core

Changeset 22258


Ignore:
Timestamp:
10/17/2012 08:57:23 PM (12 years ago)
Author:
ryan
Message:

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/query.php

    r22244 r22258  
    28002800        global $wpdb;
    28012801
    2802         if ( $q['no_found_rows'] || ! $this->posts )
     2802        // Bail if posts is an empty array. Continue if posts is an empty string
     2803        // null, or false to accommodate caching plugins that fill posts later.
     2804        if ( $q['no_found_rows'] || ( is_array( $this->posts ) && ! $this->posts ) )
    28032805            return;
    28042806
Note: See TracChangeset for help on using the changeset viewer.