Make WordPress Core

Opened 11 years ago

Closed 7 years 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 11 years ago.

Download all attachments as: .zip

Change History (10)

#1 @wonderslug
11 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.

#2 @nacin
11 years ago

  • Milestone changed from Awaiting Review to Future Release

#3 @Gecka
11 years ago

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

#4 @wlindley
10 years ago

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

#5 @duck_
10 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.

#6 @ocean90
9 years ago

  • Milestone changed from Future Release to 3.4

Closed as a duplicate: #20093

Related: #18584

#7 @nacin
9 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.

#8 @chriscct7
7 years ago

@nacin Any update on this?

#9 @helen
7 years 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.