Is it possible to add a custom field to menu items?
What I want to do is be able to add a field for ‘French Navigation Label’ and a ‘French Title Attribute’ in the wp menu interface.
Is it possible to add a custom field to menu items?
What I want to do is be able to add a field for ‘French Navigation Label’ and a ‘French Title Attribute’ in the wp menu interface.
You must be logged in to post a comment.
This will add a custom field to the menu item edit. However, you will not see the custom field until you have saved the menu for the newly added menu item. When you first add an item, you will only see the standard fields. After save, the new field will be available also for edit. If you add additional menu items, you will again have to save the menu to see and edit the custom field for the newly added items. I hope that explanation makes sense.
I was able to create and user a custom walker for creating the menu item edit fields. When you first add a menu item to the menu it seems to be entirely creating it with jQuery instead of the walker which is why you won’t see the custom field until after save.
I have creatively called the custom field I added “custom”. So you can change/edit/duplicate for whatever values you need. There are comments in the walker to show where I added the new field.
I hope this is helpful.
http://codex.wordpress.org/Custom_Fields
But – changing the functionality of the menu UI is probably something you’d have to do with a plugin. Not sure if WordPress supports such modifications out of the box.
You could write a plugin that uses Javascript and adds those input fields where needed, then saves them, and adds a filter to the menu items when they are used on the site.