Instantly share code, notes, and snippets.
@davidmh - Thanks for your work on this!
I'm getting the same error as @julian-weinert. Here's how it happens for me: I check my custom post type in the meta box, then hit submit. Then, the error is appearing above the item that was just added on the draggable menu area. Reloading the page / saving the menu gets rid of it.
Sorry, something went wrong.
Nicely done. Thanks!
The reason for the error that @julian-weinert and @jeryj (and myself) are experiencing relates to the following: I'm on 4.3 and the related lines are Line 1117 and Line 1121 which reference the $_object variable.
The wp_ajax_add_menu_item() function runs certain checks for the data provided, all of which the plugin passes, but then sets $_object through a switch for the menu-item-type which doesn't account for anything other than "custom", "post_type", or "taxonomy". Meanwhile, this plugin generates this value as the CPT name (see the original under "The AJAX").
Also, as @julian-weinert mentioned, once added to the menu, the link type reads "Custom Link" due to a similar issue in which the off-book usage doesn't trigger anything and falls through to the default labeling.