[wp-trac] [WordPress Trac] #55620: Prime caches linked objects in menu item REST API

WordPress Trac noreply at wordpress.org
Wed Jun 15 10:18:17 UTC 2022


#55620: Prime caches linked objects in menu item REST API
----------------------------------------+----------------------------------
 Reporter:  spacedmonkey                |       Owner:  spacedmonkey
     Type:  enhancement                 |      Status:  closed
 Priority:  normal                      |   Milestone:  Awaiting Review
Component:  REST API                    |     Version:  5.9
 Severity:  normal                      |  Resolution:  fixed
 Keywords:  has-patch needs-unit-tests  |     Focuses:  rest-api,
                                        |  performance
----------------------------------------+----------------------------------
Changes (by spacedmonkey):

 * status:  assigned => closed
 * resolution:   => fixed


Comment:

 In [changeset:"53504" 53504]:
 {{{
 #!CommitTicketReference repository="" revision="53504"
 REST API: Prime caches for linked objects in menu item REST API
 controller.

 Add a new parameter to `WP_Query` called `update_menu_item_cache` that
 when set to true, primes the caches for linked terms and posts for menu
 item post objects. This change moves logic
 found in `wp_get_nav_menu_items` into a new function called
 `update_menu_item_cache`.  Update the menu item REST API controller, to
 pass the `update_menu_item_cache` parameter to the
 arguments used for the  `WP_Query` run to get menu items.

 Props furi3r,  TimothyBlynJacobs, spacedmonkey, peterwilsoncc, mitogh.
 Fixes #55620.

  --This line, and those below, will be ignored--

 M    src/wp-includes/class-wp-query.php
 M    src/wp-includes/nav-menu.php
 M    src/wp-includes/rest-api/endpoints/class-wp-rest-menu-items-
 controller.php
 M    tests/phpunit/tests/post/nav-menu.php
 }}}

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


More information about the wp-trac mailing list