[wp-trac] [WordPress Trac] #60199: update_menu_item_cache appears to load postmeta for all linked posts

WordPress Trac noreply at wordpress.org
Wed Mar 27 15:18:04 UTC 2024


#60199: update_menu_item_cache appears to load postmeta for all linked posts
--------------------------+------------------------------
 Reporter:  huemordave    |       Owner:  (none)
     Type:  defect (bug)  |      Status:  new
 Priority:  normal        |   Milestone:  Awaiting Review
Component:  Menus         |     Version:  6.0
 Severity:  normal        |  Resolution:
 Keywords:  dev-feedback  |     Focuses:  performance
--------------------------+------------------------------
Changes (by flixos90):

 * keywords:  reporter-feedback => dev-feedback


Comment:

 As far as I understand @huemordave's report, the problem is that
 `update_menu_item_cache()` updates post meta for all posts in the menu. If
 the meta data is truly not used, then it is indeed wasteful to do that and
 should be reconsidered. We need to double check whether updating post meta
 is an oversight or intentional.

 Additionally, something else to point out is that
 `update_menu_item_cache()` also updates ''term'' meta for all terms
 affected. We should look at whether that data is used as well - if not, it
 could be removed too.

 @spacedmonkey My follow up question is: In [52975], why do the
 `_prime_post_caches()` and `_prime_term_caches()` calls update the meta
 cache? Is that necessary?

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/60199#comment:8>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list