Creating a wp_navigation
in REST throws undefined property error in WordPress 6.5.
#59867
Labels
[Block] Navigation
Affects the Navigation Block
[Type] Bug
An existing feature does not function as intended
Description
Creating a
wp_navigation
in REST throwsUndefined property: stdClass::$ID
error.Step-by-step reproduction instructions
Create a POST REST request on
wp/v2/navigation
with at leasttitle
orcontent
parameter set.See
debug.log
for an error such as:Screenshots, screen recording, code snippet
Here is a PHPUnit test that shows the bug:
For what I understand, the bug was introduced in this PR.
During creation, there is no
$post->ID
set yet, so doingget_post( $post->iD )
causes the error.Environment info
Please confirm that you have searched existing issues in the repo.
Yes
Please confirm that you have tested with all plugins deactivated except Gutenberg.
Yes
The text was updated successfully, but these errors were encountered: