Navigation Link block keeps reference of post ID it was created with after URL gets changed #67643
Labels
[Block] Navigation Link
Affects the Navigation Link Block
[Feature] Navigation Menus
Any issue relating to Navigation Menus
[Status] In Progress
Tracking issues with work in progress
[Type] Bug
An existing feature does not function as intended
When you add a new navigation link block it technically also adds the
id
/postTyoe
of the post/page it is linking to. This is used determine the active variation etc.<!-- wp:navigation-link {"label":"XXX","type":"page","id":123,"url":"http://xxx.xx/xxx/","kind":"post-type"} /-->
The problem is that there is no way to unlink that navigation link block from that original post that was selected. And the ID also stays there.
So if you go into an existing navigation, update all the links and labels and then at some point delete/unpublish the original post with the ID that is still in the attributes, the navigation item will not get shown on the frontend anymore. This is because core rightly so wants to not show draft posts in the navigation.
The solution here would be to remove the
id
attribute when the URL gets manually changed by the userThe text was updated successfully, but these errors were encountered: