#64611 closed defect (bug) (fixed)
Snackbar notice shows wrong message when updating navigation menus in block editor
| Reported by: |
|
Owned by: |
|
|---|---|---|---|
| Milestone: | 7.0 | Priority: | normal |
| Severity: | normal | Version: | |
| Component: | Editor | Keywords: | has-patch |
| Focuses: | Cc: |
Description
When updating a navigation menu in the block editor, the snackbar notification displays the generic message "Post updated." instead of the more specific "Navigation Menu updated." message.
Steps to Reproduce
- Navigate to the Site Editor
- Edit a navigation menu (
wp_navigationpost type) - Make changes and save
- Observe the snackbar notification
Expected behavior: The snackbar should display "Navigation Menu updated."
Actual behavior: The snackbar displays "Post updated."
Root Cause
The wp_navigation post type registration in wp-includes/post.php is missing the item_updated label in its labels array. The block editor's snackbar notification system uses this label from the REST API response to display the appropriate update message. Without this label, it falls back to the default "Post updated." message.
Solution
Add the item_updated label to the wp_navigation post type registration, following the same pattern used by other built-in post types like wp_template, wp_template_part, and wp_block (Patterns).
Change History (5)
This ticket was mentioned in PR #10882 on WordPress/wordpress-develop by @juanfra.
2 months ago
#1
- Keywords has-patch added
@westonruter commented on PR #10882:
2 months ago
#2
I tried to reproduce the issue, and it took me a bit to figure out how to do it. I had to make sure that I created a separate nav menu first. Then, I had to actually click into it in the main canvas to and make a change there, I couldn't make the change from the sidebar (e.g. by dragging):
https://github.com/user-attachments/assets/1a3d8f5b-c5ac-421c-b4c2-627648c8610e
#3
@
2 months ago
- Milestone changed from Awaiting Review to 7.0
- Owner set to westonruter
- Status changed from new to reviewing
@juanfra commented on PR #10882:
2 months ago
#5
Thanks for testing this and taking the time to figure it out, @westonruter!
Sorry about that, I'll make sure to be more precise next time.
Trac ticket: https://core.trac.wordpress.org/ticket/64611
This PR adds the missing
item_updatedlabel to thewp_navigationpost type registration to fix the snackbar notification in the block editor showing "Post updated." instead of "Navigation Menu updated." when updating navigation menus.### Testing
https://github.com/user-attachments/assets/35ce0b6e-21d9-4625-9507-db4884fe775d