Navigation Menu does not updates after a page or post is deleted, which leads to inconsistent menu in backend and frontend
|Reported by:||UmeshSingla||Owned by:||ocean90|
If I've added a page in menu and later I delete it permanently, It does not get remove from menu items and instead displays notice as $original_object = get_post( $menu_item->object_id ); in nav_menu.php on line 596 returns nothing.
Wordpress Version 3.8
To replicate the issue:
- Create a Normal Page.
- Add page to menu and Update it.
- Delete the Page Permanently
- If debug is turned, php notice are there on the menu page in backend as well as frontend. If debug is off you can still see the space for items in menu.
- On saving the menu back, the menu item is removed.
It happens as _wp_delete_post_menu_item is not updating the menu items on delete_post hook
Change History (29)
- Keywords needs-patch added; has-patch needs-testing removed
- Milestone changed from Awaiting Review to 3.9
3 years ago
- Summary changed from Deleting a page do not updates menu items and generates Notices in frontend and backend to Navigation Menu does not updates after a page or post is deleted, which leads to inconsistent menu in backend and frontend
- Keywords commit added
- Owner set to ocean90
- Status changed from new to assigned