mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-06-30 23:30:05 +00:00
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. git-svn-id: https://develop.svn.wordpress.org/trunk@54410 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -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 );
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user