[wp-trac] [WordPress Trac] #18584: Nav menu UI needs more hooks

WordPress Trac noreply at wordpress.org
Wed Jun 25 23:57:27 UTC 2014


#18584: Nav menu UI needs more hooks
-----------------------------------------------+---------------------------
 Reporter:  Viper007Bond                       |       Owner:
     Type:  enhancement                        |      Status:  new
 Priority:  low                                |   Milestone:  Future
Component:  Menus                              |  Release
 Severity:  minor                              |     Version:  3.3
 Keywords:  has-patch needs-testing 3.9-early  |  Resolution:
                                               |     Focuses:
-----------------------------------------------+---------------------------

Comment (by helgatheviking):

 In the meantime, per @Shazdeh's very neat suggestion at:
 http://shazdeh.me/2014/06/25/custom-fields-nav-menu-items/

 I am modifying the Walker in my plugin to only add the following action
 hook right after the description input:


 {{{
 <?php
 // This is the added section
 do_action( 'wp_nav_menu_item_custom_fields', $item_id, $item, $depth,
 $args );
 // end added section
 ?>
 }}}

 Then I am adding my custom fields to this hook. If we all do this in our
 plugins (those of us with plugins that rely on replacing the
 `wp_edit_nav_menu_walker`) then our plugins can play together. People will
 just have to run the risk of hitting the $_POST limit... a risk they are
 already taking now. If this hook is ever added to core, the plugins should
 seamless be forward-compatible.

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


More information about the wp-trac mailing list