[wp-trac] [WordPress Trac] #38904: Add action hook in class-walker-nav-menu-edit.php

WordPress Trac noreply at wordpress.org
Thu Feb 2 16:24:34 UTC 2017


#38904: Add action hook in class-walker-nav-menu-edit.php
------------------------------------+------------------------------
 Reporter:  timersys                |       Owner:
     Type:  enhancement             |      Status:  new
 Priority:  normal                  |   Milestone:  Awaiting Review
Component:  Menus                   |     Version:  4.7
 Severity:  normal                  |  Resolution:
 Keywords:  has-patch dev-feedback  |     Focuses:  administration
------------------------------------+------------------------------

Comment (by adamsilverstein):

 @timersys & @welcher - thanks for the bug report and patch.

 I found several related tickets although there seems to be some confusion
 on hooks for admin vs. front end.

 My concern with the current patch is it is so narrowly focused &
 application/need specific. While it solves the reported use case, what if
 plugins want to add something to a submenu or alter the classes added to
 menus? We might need many hooks to address every use case. I think this is
 the reason the general approach of replacing the walker has been used, and
 was the resolution for #13342.

 A more generic filter applied to the return of `start_el` might be worth
 considering (as suggested in #27280). This would still let you add menu
 items (although it would require a bit more care to find the correct
 insertion point) without replacing `Walker_Nav_Menu_Edit` entirely.

 What do you think @timersys, would that still be useful?

--
Ticket URL: <https://core.trac.wordpress.org/ticket/38904#comment:8>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list