Make WordPress Core


Ignore:
Timestamp:
10/07/2022 09:58:32 AM (2 years ago)
Author:
spacedmonkey
Message:

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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/class-wp-query.php

    r54352 r54410  
    32693269        }
    32703270
    3271         if ( ! empty( $this->posts ) && $q['update_menu_item_cache'] ) {
    3272             update_menu_item_cache( $this->posts );
    3273         }
    3274 
    32753271        if ( ! $q['suppress_filters'] ) {
    32763272            /**
     
    34673463        }
    34683464
     3465        if ( ! empty( $this->posts ) && $q['update_menu_item_cache'] ) {
     3466            update_menu_item_cache( $this->posts );
     3467        }
     3468
    34693469        if ( $q['lazy_load_term_meta'] ) {
    34703470            wp_queue_posts_for_term_meta_lazyload( $this->posts );
Note: See TracChangeset for help on using the changeset viewer.