WordPress.org

Make WordPress Core

Changeset 52155


Ignore:
Timestamp:
11/15/2021 12:10:39 AM (2 months ago)
Author:
noisysocks
Message:

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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/navigation-areas.php

    r52145 r52155  
    109109
    110110        if ( ! empty( $matching_posts ) ) {
    111             $navigation_post_id = $matching_posts[0]->ID;
     111            $navigation_post_id = $matching_posts[0];
    112112        } else {
    113113            $menu_items_by_parent_id = _wp_sort_menu_items_by_parent_id( $menu_items );
Note: See TracChangeset for help on using the changeset viewer.