[wp-trac] [WordPress Trac] #23806: Nav Menu Edit Walker per menu item type, not menu?

WordPress Trac noreply at wordpress.org
Wed Nov 27 15:11:10 UTC 2013


#23806: Nav Menu Edit Walker per menu item type, not menu?
-------------------------+------------------------------
 Reporter:  GaryJ        |       Owner:
     Type:  enhancement  |      Status:  new
 Priority:  normal       |   Milestone:  Awaiting Review
Component:  Menus        |     Version:
 Severity:  normal       |  Resolution:
 Keywords:  needs-patch  |
-------------------------+------------------------------

Comment (by bendoh):

 Bumping this.

 Currently there's no great way to add or remove fields from custom nav
 item types other than by (as the ticket says) copying / extending
 Walker_Nav_Menu_Edit, and adding logic there to add / remove the fields.
 But to do this, you must filter on wp_edit_nav_menu_walker and provide
 your own custom walker (wp-admin/includes/ajax-actions.php:960 w/ WP
 3.7.1), but this isn't really stackable in any custom way, since another
 plugin or theme might offer a different class name for this class and thus
 bypass any custom functionality offered by the custom
 Walker_Nav_Menu_Edit.

 It'd be nice to be able to filter the markup before it's output, instead,
 since then multiple plugins could process this.

 I've attached a patch against WP 3.7.1 (trac.23806.diff) that creates two
 new filters: 'pre_nav_menu_edit_item', which allows for plugins to provide
 a completely custom chunk of markup to use for the menu item editing; and
 'nav_menu_edit_item', which allows for manipulation of the generated HTML
 that is about to be used.

--
Ticket URL: <http://core.trac.wordpress.org/ticket/23806#comment:4>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list