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
This commit is contained in:
Robert Anderson 2021-11-15 00:10:39 +00:00
parent 8154a715b4
commit 02ad588c99

View File

@ -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 );