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
This commit is contained in:
spacedmonkey 2022-10-07 10:00:15 +00:00
parent 148049329d
commit be3c6666d9
2 changed files with 5 additions and 5 deletions

View File

@ -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 );
}

View File

@ -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.