From be3c6666d9ebd6297d70bd307af8cce300657db9 Mon Sep 17 00:00:00 2001 From: spacedmonkey Date: Fri, 7 Oct 2022 10:00:15 +0000 Subject: [PATCH] Query: Move call to `update_menu_item_cache` in `WP_Query` Move call to `update_menu_item_cache` in `WP_Query` to after post meta caches for menu items are primed. Props spacedmonkey, peterwilsoncc, mukesh27. See #55620. Built from https://develop.svn.wordpress.org/trunk@54410 git-svn-id: http://core.svn.wordpress.org/trunk@53969 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/class-wp-query.php | 8 ++++---- wp-includes/version.php | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/wp-includes/class-wp-query.php b/wp-includes/class-wp-query.php index 7af38f135b..8525987454 100644 --- a/wp-includes/class-wp-query.php +++ b/wp-includes/class-wp-query.php @@ -3268,10 +3268,6 @@ class WP_Query { wp_cache_set( $cache_key, $cache_value, 'posts' ); } - if ( ! empty( $this->posts ) && $q['update_menu_item_cache'] ) { - update_menu_item_cache( $this->posts ); - } - if ( ! $q['suppress_filters'] ) { /** * Filters the raw post results array, prior to status checks. @@ -3466,6 +3462,10 @@ class WP_Query { $this->posts = array(); } + if ( ! empty( $this->posts ) && $q['update_menu_item_cache'] ) { + update_menu_item_cache( $this->posts ); + } + if ( $q['lazy_load_term_meta'] ) { wp_queue_posts_for_term_meta_lazyload( $this->posts ); } diff --git a/wp-includes/version.php b/wp-includes/version.php index 96cd3fc894..82e5bd0f37 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -16,7 +16,7 @@ * * @global string $wp_version */ -$wp_version = '6.1-beta3-54409'; +$wp_version = '6.1-beta3-54410'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.