From bd2fafae0afdc3deb47cf616e4a2ee1f07a67d42 Mon Sep 17 00:00:00 2001 From: Boone Gorges Date: Wed, 15 Jun 2016 12:33:29 +0000 Subject: [PATCH] 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 --- wp-includes/query.php | 5 +++-- wp-includes/version.php | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/wp-includes/query.php b/wp-includes/query.php index 8ec85b2127..ba4d335d74 100644 --- a/wp-includes/query.php +++ b/wp-includes/query.php @@ -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 ) { $this->posts = array_map( 'get_post', $this->posts ); - $this->set_found_posts( $q, $limits ); } if ( ! $q['suppress_filters'] ) { diff --git a/wp-includes/version.php b/wp-includes/version.php index 094297837d..f56a32d5f9 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -4,7 +4,7 @@ * * @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.