Opened 14 years ago
Closed 13 years ago
#14527 closed defect (bug) (fixed)
ajax call for add-menu-item doesnt supprot wp_edit_nav_menu_walker filter
Reported by: | wonderslug | Owned by: | nacin |
---|---|---|---|
Milestone: | 3.4 | Priority: | normal |
Severity: | normal | Version: | 3.0.1 |
Component: | Menus | Keywords: | has-patch commit |
Focuses: | Cc: |
Description
The wp_get_nav_menu_to_edit function (wp-admin/includes/nav-menu.php) supports a filter on the wp_edit_nav_menu_walker in order for plugins to pass a different walker class to the menu item admin.
The ajax call (add-menu-item) supporting the creation of a new menu-item that uses this same walker is not supporting the filter.
In order to make it so that both and and existing menu items support are calling the same walker to get the html for menu items this filter need to be added to the ajax.
I am attaching a patch that works.
Attachments (3)
Change History (9)
#1
@
14 years ago
- Keywords has-patch 3.2-early commit added; nav_menu walker removed
- Milestone changed from Awaiting Review to Future Release
#2
@
13 years ago
- Component changed from Administration to Menus
- Keywords 3.2-early removed
- Milestone changed from Future Release to 3.4
I just run into this issue.
#3
@
13 years ago
-1 implies a permissions issue, 0 is generally used for failures. (Does the code that triggers this ajax know to look for -1/0?)
Normally, we'd probably avoid the class_exists() (and show devs their error), since this is already in a released version, it makes sense to avoid the errors.
A few plugins use the wp_edit_nav_menu_walker filter. How many of them don't load the class they want via Ajax?
./plugins/gantry/widgets/menu.php:51: add_filter('wp_edit_nav_menu_walker', array("GantryWidgetMenu", "setupWalker"), 1000, 2); ./plugins/gecka-submenu/models/NavMenuHacks.php:10: add_filter( 'wp_edit_nav_menu_walker', array($this, 'custom_walker') ); ./plugins/menu-items-visibility-control/menu-items-visibility.php:26: add_filter( 'wp_edit_nav_menu_walker', 'boom_nav_menu_edit_custom_walker' );
Patch