From ff1e74602dfa1dfe2f48a6a703933eae4926919f Mon Sep 17 00:00:00 2001 From: spacedmonkey Date: Fri, 25 Mar 2022 09:56:05 +0000 Subject: [PATCH] Query: Ensure that sticky post query returns all sticky posts. Ensure that the `posts_per_page` parameter submit to sticky post query matches the number of sticky posts requested. Follow-up to [52982] Props Spacedmonkey, peterwilsoncc. See #36907. Built from https://develop.svn.wordpress.org/trunk@52990 git-svn-id: http://core.svn.wordpress.org/trunk@52579 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/class-wp-query.php | 1 + wp-includes/version.php | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/wp-includes/class-wp-query.php b/wp-includes/class-wp-query.php index 10e7a3c7fa..35b29a902d 100644 --- a/wp-includes/class-wp-query.php +++ b/wp-includes/class-wp-query.php @@ -3263,6 +3263,7 @@ class WP_Query { 'post__in' => $sticky_posts, 'post_type' => $post_type, 'post_status' => 'publish', + 'posts_per_page' => count( $sticky_posts ), 'suppress_filters' => $q['suppress_filters'], 'cache_results' => $q['cache_results'], 'update_post_meta_cache' => $q['update_post_meta_cache'], diff --git a/wp-includes/version.php b/wp-includes/version.php index 22ab546e50..df58ca8d7d 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -16,7 +16,7 @@ * * @global string $wp_version */ -$wp_version = '6.0-alpha-52989'; +$wp_version = '6.0-alpha-52990'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.