WordPress.org

Ready to get started?Download WordPress

Plugin Directory

Custom Menu Fields

Provides an API to add custom fields to the menu editor.

This plugin provides an API which allows the developer of a site to add custom fields on the default menu editor.

Example Initialisation

<?php
add_action('init', 'menu_excerpt__add_menu_field');
function menu_excerpt__add_menu_field() {
    if (!is_callable('bh_add_custom_menu_fields'))
        return;

    bh_add_custom_menu_fields(array(
        'excerpt' => array(
            'description' => 'Excerpt',
            'type' => 'textarea',
            )));
}
?>

Getting the Value

This is simple. Once initialised, get the nav menu using wp_nav_menu with 'echo' => false:

$menu = wp_nav_menu('theme_location' => 'location-name', 'echo' => false);

Then you can access via the attribute of the same name as your definition step specified (with - replaced with _):

print $menu->excerpt; // this is the field I created above

NOTE

This plugin does nothing by itself. It provides an API only.

Tags: , , ,

Requires: 3.5 or higher
Compatible up to: 3.7.1
Last Updated: 2014-3-24
Downloads: 171

Ratings

5 stars
5 out of 5 stars

Support

Got something to say? Need help?

Compatibility

+
=
Not enough data

0 people say it works.
0 people say it's broken.