I’ve added an hook to switch a post type from ‘post’ to ‘lodging’ and when I add the code below I can’t add items to the menu. The menu item title is something like ‘#78 (no title)’ and when I save it I get the message ‘The given object ID is not that of a menu item’.
The code is: