Make WordPress Core


Ignore:
Timestamp:
06/15/2022 10:18:02 AM (3 years ago)
Author:
spacedmonkey
Message:

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

File:
1 edited

Legend:

Unmodified
Added
Removed
Note: See TracChangeset for help on using the changeset viewer.