From a42b89fc71ef3ea360ae616176f0a7570d4ecf1b Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Wed, 15 Jun 2022 13:37:10 +0000 Subject: [PATCH] REST API: Some documentation and test improvements for `update_menu_item_cache()`: * Make the function description more specific, for consistency with other similar functions. * Add a `@since` note for the `$update_menu_item_cache` parameter of `WP_Query::parse_query()`. * Add missing `@covers` tags for the unit tests. Follow-up to [53504]. See #55620. Built from https://develop.svn.wordpress.org/trunk@53508 git-svn-id: http://core.svn.wordpress.org/trunk@53097 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/class-wp-query.php | 1 + wp-includes/nav-menu.php | 5 +++-- wp-includes/version.php | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/wp-includes/class-wp-query.php b/wp-includes/class-wp-query.php index a0d364976e..fb1fea61fb 100644 --- a/wp-includes/class-wp-query.php +++ b/wp-includes/class-wp-query.php @@ -627,6 +627,7 @@ class WP_Query { * @since 4.9.0 Introduced the `$comment_count` parameter. * @since 5.1.0 Introduced the `$meta_compare_key` parameter. * @since 5.3.0 Introduced the `$meta_type_key` parameter. + * @since 6.1.0 Introduced the `$update_menu_item_cache` parameter. * * @param string|array $query { * Optional. Array or string of Query parameters. diff --git a/wp-includes/nav-menu.php b/wp-includes/nav-menu.php index c018cf23f9..8df3cd2cc8 100644 --- a/wp-includes/nav-menu.php +++ b/wp-includes/nav-menu.php @@ -753,11 +753,11 @@ function wp_get_nav_menu_items( $menu, $args = array() ) { } /** - * Prime all linked objects to menu items. + * Updates post and term caches for all linked objects for a list of menu items. * * @since 6.1.0 * - * @param WP_Post[] $menu_items Array post objects of menu items. + * @param WP_Post[] $menu_items Array of menu item post objects. */ function update_menu_item_cache( $menu_items ) { $post_ids = array(); @@ -767,6 +767,7 @@ function update_menu_item_cache( $menu_items ) { if ( 'nav_menu_item' !== $menu_item->post_type ) { continue; } + $object_id = get_post_meta( $menu_item->ID, '_menu_item_object_id', true ); $type = get_post_meta( $menu_item->ID, '_menu_item_type', true ); diff --git a/wp-includes/version.php b/wp-includes/version.php index a47a548fff..804d64009a 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -16,7 +16,7 @@ * * @global string $wp_version */ -$wp_version = '6.1-alpha-53507'; +$wp_version = '6.1-alpha-53508'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.