Query: After [37692], don't skip `set_found_posts()` when no posts are found.

The 'found_posts' filter must continue to run for plugins manipulating post
results via filter.

Props dd32.
Fixes #36687.
Built from https://develop.svn.wordpress.org/trunk@37712


git-svn-id: http://core.svn.wordpress.org/trunk@37678 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Boone Gorges 2016-06-15 12:33:29 +00:00
parent 64ea32feea
commit bd2fafae0a
2 changed files with 4 additions and 3 deletions

View File

@ -3650,10 +3650,11 @@ class WP_Query {
} }
} }
// Convert to WP_Post objects and set the found-post totals. $this->set_found_posts( $q, $limits );
// Convert to WP_Post objects.
if ( $this->posts ) { if ( $this->posts ) {
$this->posts = array_map( 'get_post', $this->posts ); $this->posts = array_map( 'get_post', $this->posts );
$this->set_found_posts( $q, $limits );
} }
if ( ! $q['suppress_filters'] ) { if ( ! $q['suppress_filters'] ) {

View File

@ -4,7 +4,7 @@
* *
* @global string $wp_version * @global string $wp_version
*/ */
$wp_version = '4.6-alpha-37710'; $wp_version = '4.6-alpha-37712';
/** /**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema. * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.