Make WordPress Core

Opened 5 years ago

Closed 11 months ago

#14414 closed feature request (duplicate)

Add an action hook to add fields to nav_menu items form

Reported by: DreadLox Owned by: Gecka
Milestone: Priority: normal
Severity: normal Version: 3.1
Component: Menus Keywords: has-patch
Focuses: Cc:



In order to add a custom field to a nav menu item form, I have to setup a custom walker whereas a simple action hook could do the trick. Everything else is ok to handle and save the custom field. (http://loxdev.knc.nc/blog/wordpress/auto-populate-nav-menu-with-sub-pages/)

Here is how the asked action hook could be added:

Attachments (1)

nav_menu_custom_fields.patch (644 bytes) - added by Gecka 5 years ago.

Download all attachments as: .zip

Change History (10)

comment:1 @wonderslug5 years ago

I think this should really be an alternative to the wp_edit_nav_menu_walker filter, which replaces the walker classname. This filter will cause clashes if multiple plugins change the classname of the walker. Only the last filter run will win.

This action would be a way for multiple plugins to add fields to the menu items (like is done with widget fields right now) and not have conflicts.

comment:2 @nacin5 years ago

  • Milestone changed from Awaiting Review to Future Release

comment:3 @Gecka5 years ago

  • Keywords has-patch added
  • Owner set to Gecka
  • Status changed from new to accepted
  • Version set to 3.1

comment:4 @wlindley4 years ago

Is there any reason this one-line patch cannot be incorporated into 3.3 ...?

comment:5 @duck_4 years ago

Closed #18889 as a duplicate. It had ticket18889.patch which suggested a large number of new filters.

Is there any reason this one-line patch cannot be incorporated into 3.3 ...?

Because the time for feature requests / enhancements passed a while ago.

comment:6 @ocean904 years ago

  • Milestone changed from Future Release to 3.4

Closed as a duplicate: #20093

Related: #18584

comment:7 @nacin4 years ago

  • Milestone changed from 3.4 to Future Release

Since this is part of a walker, those doing big customizations can replace it. We should probably solve issues like nav-menus.php saving quite a bit of data before we open this up too much. Per IRC scrub.

comment:8 @chriscct711 months ago

@nacin Any update on this?

comment:9 @helen11 months ago

  • Milestone Future Release deleted
  • Resolution set to duplicate
  • Status changed from accepted to closed

Calling this a dupe of #18584. Patch there includes this and is more comprehensive, and has more discussion.

Note: See TracTickets for help on using tickets.