[wp-trac] [WordPress Trac] #58044: Issue with wp_setup_nav_menu_item
WordPress Trac
noreply at wordpress.org
Mon Apr 3 18:12:20 UTC 2023
#58044: Issue with wp_setup_nav_menu_item
-------------------------------------------+------------------------------
Reporter: wpweaver | Owner: (none)
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Menus | Version: 6.2
Severity: normal | Resolution:
Keywords: needs-patch reporter-feedback | Focuses: administration
-------------------------------------------+------------------------------
Comment (by wpweaver):
Looks as if it could be the same issue - from a couple of years ago. I
didn't find it when I searched.
But in this case, that issue may have a bit different cause, or have not
been fixed. After tracking down the NULL item at the failure point, I did
find such an orphan menu item and removed it which also fixed the issue.
The issue does seem to originate from defining a menu when a menu item no
longer exists, or uses a Parent page that no longer exists, and only
happened when loading the Customizer. Whatever, call to
`get_post_states()` can pass a null page here. Perhaps the check belongs
in `get_post_states` as it could be called from other instances, but I
think it happens only from menu items.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/58044#comment:2>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list