From 02ad588c9961f965e5e8409237ee83defddb35c1 Mon Sep 17 00:00:00 2001 From: Robert Anderson Date: Mon, 15 Nov 2021 00:10:39 +0000 Subject: [PATCH] Editor: Fix incorrect access of ID field Now that WP_Query is set to return 'ids', accessing $matching_posts[0]->ID is incorrect. Props spacedmonkey. Follows [52145]. See #54337. git-svn-id: https://develop.svn.wordpress.org/trunk@52155 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-includes/navigation-areas.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/wp-includes/navigation-areas.php b/src/wp-includes/navigation-areas.php index e2d7460c38..67712f507c 100644 --- a/src/wp-includes/navigation-areas.php +++ b/src/wp-includes/navigation-areas.php @@ -108,7 +108,7 @@ function _wp_migrate_menu_to_navigation_post( $new_name, WP_Theme $new_theme, WP ); if ( ! empty( $matching_posts ) ) { - $navigation_post_id = $matching_posts[0]->ID; + $navigation_post_id = $matching_posts[0]; } else { $menu_items_by_parent_id = _wp_sort_menu_items_by_parent_id( $menu_items ); $parsed_blocks = _wp_parse_blocks_from_menu_items( $menu_items_by_parent_id[0], $menu_items_by_parent_id );