[wp-trac] [WordPress Trac] #23805: wp_ajax_add_menu_item() closed to user-created menu item types
WordPress Trac
noreply at wordpress.org
Tue Mar 31 22:48:32 UTC 2015
#23805: wp_ajax_add_menu_item() closed to user-created menu item types
--------------------------+------------------------------
Reporter: GaryJ | Owner:
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Menus | Version:
Severity: normal | Resolution:
Keywords: has-patch | Focuses:
--------------------------+------------------------------
Comment (by rtpHarry):
I was just about to report this but it seems that it's already known.
If you use custom menu-item-type's to extend the menu you will see errors
like this when you try to add your custom item to the nav menu in `/wp-
admin/nav-menus.php`:
{{{
Notice: Undefined variable: _object in /srv/www/basetemplate/htdocs/wp-
admin/includes/ajax-actions.php on line 1091
Notice: Trying to get property of non-object in
/srv/www/basetemplate/htdocs/wp-admin/includes/ajax-actions.php on line
1095
}}}
Note: This is only shown while developing with `define( 'WP_DEBUG', true
);`
Disabling JavaScript and attempting to add the custom item adds it with
(Pending) and then you can save the menu without any issues so it seems
like this is an ajax only issue.
It looks like the one line .diff submitted with this ticket would solve
the problem.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/23805#comment:3>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list