-
-
Save davidmh/8050982 to your computer and use it in GitHub Desktop.
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.
Nicely done. Thanks!