Plugin info

Total downloads: 3,492
Active installs: 40
Total reviews: 2
Average rating: 5
Support threads opened: 0
Support threads resolved: 0 (0%)
Available in: 1 language(s)
Contributors: 1
Last updated: 9/20/2021 (1563 days ago)
Added to WordPress: 1/28/2014 (11 years old)
Minimum WordPress version: 3.5
Tested up to WordPress version: 3.7.41
Minimum PHP version: f

Maintenance & Compatibility

Maintenance score

Possibly abandoned • Last updated 1563 days ago • 2 reviews

22/100

Is Custom Menu Fields abandoned?

Possibly abandoned (last update 1563 days ago).

Compatibility

Requires WordPress: 3.5
Tested up to: 3.7.41
Requires PHP: f

Similar & Alternatives

Explore plugins with similar tags, and compare key metrics like downloads, ratings, updates, support, and WP/PHP compatibility.

Custom Field Template
Rating 4.0/5 (24 reviews)Active installs 30,000
Flexible Content Extended for Advanced Custom Fields
Rating 5.0/5 (4 reviews)Active installs 900
Advanced Custom Post Types
Rating 3.7/5 (3 reviews)Active installs 300
Remove Fields
Rating 4.5/5 (4 reviews)Active installs 100
Bonzer Custom Fields Creator
Rating 0.0/5 (0 reviews)Active installs 20
ACF Additional Hint
Rating 4.0/5 (1 reviews)Active installs 10

Description

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

Example Initialisation

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

Accessing the fields

The easiest way to access the field(s) you’ve added is to use something along the lines of:

$menu = 'menuName';
$posts = wp_get_nav_menu_items($menu);
foreach ($posts as $p) {
    $myitem = get_post_meta($p->ID, '_menu_item_youritem', true);
    // do with $myitem what you like - it should be a string,
    // so the simplest thing is to "echo" it
}

you can use menu locations to get the menu name if you prefer – replace the first line above with:

$locations = get_nav_menu_locations();
$menu = $locations['locationName'];

menu locations are useful if you like to swap your menus about.

Unfortunately these examples don’t allow the use of wordpress’ inbuilt menu walkers. To use those you will need to create a custom walker_nav_menu class and access the custom fields with something along the lines of (very stripped down example will need fleshing out for full walker functionality – there are tutorials on the net for custom nav walkers):

class mywalker extends Walker_Nav_Menu {
    function start_el(&$output, $item, $depth, $args) {
        echo $item->custom_field
    }
}

The important bit here is that the field is placed on the second variable which behaves like an object. the custom_field part is the name you gave your field with dashes replaced with underscores (to allow the name to be used in an accessor).

NOTE

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

Installation

This section describes how to install the plugin and get it working.

  1. Upload the folder from the zip to the /wp-content/plugins/ directory
  2. Activate the plugin through the ‘Plugins’ menu in WordPress
  3. Once activated the API is available in the ‘init’ and later phases of the WordPress lifecycle.

Frequently Asked Questions

No FAQ available

Review feed

No reviews available

Screenshots

No screenshots available

Changelog

0.2

version bump to attempt to rectify auto-update mechanism

0.1

first release