Forked from helgatheviking/custom-post-type-archive-menu-links.php
Last active
October 14, 2016 08:11
-
-
Save davidmh/8050982 to your computer and use it in GitHub Desktop.
Adds Custom Post Type archives to the WordPress-powered menus. Compatible with WP 3.8
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.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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
andLine 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 themenu-item-type
which doesn't account foranything other than"custom", "post_type", or "taxonomy". Meanwhile, this plugin generates this value as the CPT name (see the original under "The AJAX").