Custom Menu Wizard Widget

Custom Menu Wizard Widget

Show branches or levels of your menu in a widget, or in content using a shortcode, with full customisation.
Rating:
4.7
star-rating-1star-rating-2star-rating-3star-rating-4star-rating-5
Active Installations:
3000+
Last Updated:
Apr 02, 2018
WordPress Version:
3.9 or higher
Tested up to:
4.9.26

Custom Menu Widget

Full control over parameters

This plugin provides full control over most of the parameters available when calling WP's wp_nav_menu() function. You can display an entire menu, just a branch of it, just certain levels of it, or even just specific items from it. You can also select a branch based on a specific menu item or the current menu item.

Filter Menu Items

Select specific items

3.3.1

  • bugfix : try to prevent other plugins lowering the z-index value of UI dialog
  • bugfix : corrected a ‘count()’ typo in the walker class when checking for multiple Current Item candidates
  • verified for WordPress 4.9.4

3.3.0

  • change : minimum WordPress version is now 3.9! (because require .dashicons-before, as part of needing to dump jQuery UI theme)
  • bugfix : ! Possible Breaker ! fixed incorrect determination of current item when a “current menu item” has a duplicate of itself as an ancestor (hopefully rare). There is a (very slight) chance that this may affect your displayed menu : if it does, toggle the Fallback option for If more than 1 possible Current Item, and I apologise for not catching the problem earlier
  • change : dumped jQuery UI’s Smoothness theme for WordPress’s own CSS, to work around styling issues with WP4.5
  • change : removed the hide_empty option (only relevant pre WP3.6) entirely
  • change : remove support for Widget Customizer plugin (part of core from WP3.9)
  • change : localized all text used by assist, to reduce byte footprint of the widget
  • add : in customizer, if there are no menus, link to the customizer’s menus panel
  • add : opt in to customizer selective refresh for widgets (WP4.5)
  • bugfix : correction to regexps that sanitize the alternative
  • bugfix : corrected some problems with the assist dialog’s auto-sizing, particularly after dragging
  • tweak : squidged the widget form a bit, to reduce byte footprint of the widget
  • tweak : included screenshots in html version of documentation

3.2.6

  • addition : add cmw-current-item class to the menu item that CMW is using as ‘current item’

3.2.5

  • addition : add cmw-menu-item-had-children class to any menu item that originally had children, regardless of whether it still does when output

3.2.4

  • bugfix : improve handling of dynamically-generated items, by pre-sorting into menu_order order and coping with negative item ids
  • documentation : updated FAQs

3.2.3

  • tweak : minor updates to documentation, and verified for WordPress v4.4

3.2.2

  • bugfix : fixed initial widget display when adding new widget instance in the customizer

3.2.1

  • bugfix : missing echo statement for the update message

3.2.0

  • internationalization

3.1.5

  • addition : expanded Title From to allow absolute ancestor levels (besides root) and relative ancestor levels
  • addition : added a fallback option to switch determination of Current Item from first-found to last-found
  • addition : added a shortcode attribute that loads an existing widget instance : [cmwizard widget=N/]
  • documentation : updated, and provided an html version in the plugin download

3.1.4

  • bugfix : in shortcode processing, any supplied Alternative settings weren’t being used. thanks corrideat
  • bugfix : prevent texturization of shortcode’s content, for when it is being used with an Alternative setting
  • addition : the ability to make a title into a link when the title has been set from a menu item

3.1.3

  • tweak : minor change to css for the assist when running under the Customizer (WordPress 4.1)

3.1.2

  • modified the readme : documentation for the Shortcode Attributes has been moved to the Installation page (to avoid being truncated)

3.1.1

  • bugfix : only show the allow_all_root setting in the shortcode equivalent if the primary filter is by branch
  • addition : work-around for when a theme inadvertently(!) de-registers the widget, which then prevents the shortcode working

3.1.0

  • addition : new Alternative section which takes a cmwizard shortcode and conditionally applies it as an entirely new widget configuration
  • addition : new fallback switch which enables an item marked as current_item_parent to be used as current item when no other current item is found
  • bugfix : updated the determination of current item so that a paged (?paged=2, etc) Home page still shows Home page as being current
  • bugfix : fixed code introduced in v3.0.4 that prevented CMW script loading on the customizer page – when the Widget Customizer plugin is loaded – for WordPress v3.8 and below
  • bugfix : stop disabling selected fields based on other settings, because this caused the customizer to wipe values that may have been still required

3.0.4

  • bugfix : corrected the display of the “No Current Item!” warning in the “assist”
  • bugfix : corrected the enabling/disabling of a couple of fields in the widget form, and tweaked the indentation for better responsiveness
  • bugfix : corrected the options setup when in accessibility mode with javascript enabled
  • addition : added a warning about the accuracy of the shortcode when javascript is disabled
  • addition : extended the All Root Items inclusion to be a selectable number of levels (as per the Exclusions by Level)

3.0.3

  • bugfix : removed all occurrences of “Plugin ” followed by “Name” from everywhere except the main plugin file to avoid update() reporting Invalid Header when activating straight from installation (rather than from the Plugins page)
  • tweak : eliminate the over-use of get_title() when determining the widget title
  • tweak : added self-terminating forward slash to generated shortcodes
  • change : prepare for WordPress v4 (avoid use of deprecated functions)

3.0.2

  • bugfix : the shortcode display on new instances of the widget (in admin) did not initially reflect the automatically-selected menu

3.0.1

  • bugfix : changed the determination of pre-existing legacy widgets versus brand new widget instances, to get round problems encountered when other plugins utilise the widget_form_callback filter to inject fields into a widget
  • addition : added a couple of filters

3.0.0

  • ! Rewrite, and Change of Approach ! The widget has had a major rewrite! The Children of filter has been replaced with a Branch filter, with a subsequent shift in focus for the secondary filter options, from the children’s level (0, 1 or more items) up to the branch level (a single item!). This should provide a more intuitive interface, and is definitely easier to code for. However, it only affects new instances of the widget; v2 instances are still fully supported.

    Please also note that the shortcode tag for v3 has changed to [cmwizard], with a revised set of attributes. The old shortcode tag is still supported, but only with the v2 attribute set, and only providing v2 functionality, ie. it is the shortcode tag that determines which widget version to use, and the appropriate attribute set for that version.

    There is no automatic upgrade of widget settings from v2 to v3! I suggest bringing up the “assist” for the existing v2 widget, running it side-by-side with the “assist” of a new instance of the widget, and using them to the compare the desired outputs. I would also strongly recommend that you put your old widgets into the inactive area until you are completely happy with their new replacements. If you are upgrading from version 2, and you would like a bit more information, this article might help.

  • change : the minmum requirement for WordPress is v3.6
  • addition : more options for requiring that the “current” menu item be present at some point in the filter process
  • addition : Branch filter levels can be either relative (to the selected Branch item) or absolute (within the menu structure)
  • addition : menu items can now be excluded from the final output, either explicitly by id (optionally including descendants), or by level
  • addition : the ids of Items can be set to include all descendants
  • addition : the inclusion of branch ancestors, and optionally their siblings, can be set by absolute level or relative number of levels
  • addition : the widget title can now be automatically set from the root level item of the Branch item or current menu item
  • addition : the shortcode for a widget’s current settings is now also displayed at the base of the widget (as well as at the base of the “assist”)
  • addition : “title_tag” has been added to the shortcode options, enabling the default H2 to be changed without having to resort to coding a filter
  • addition : as an alternative to using the “assist”, “findme” has been addded to the shortcode options to aid editors with the location of posts containing a CMW shortcode ([cmwizard findme=1])
  • This release includes an upgrade to v2.1.0 for all existing version 2 widgets/shortcodes – please read the v2.1.0 changes below.

2.1.0 (incorporated into v3.0.0 release)

  • change : the minmum requirement for WordPress is v3.6
  • bugfix : handle duplicate menu item ids which were causing elements to be ignored
  • bugfix : fix IE8 levels indentation in the “assist”
  • bugfix : the “assist” is now “fixed” position (toggle-able back to absolute), mainly to get around a bug in jQuery UI draggable
  • remove : take out the automatic selection of shortcode text (inconsistent cross-browser, so just triple click as usual; paste-as-text if possible!)
  • addition : in the “assist”, provide collapsible options for those larger menus
  • addition : added utility to the “assist” enabling posts containing a CMW shortcode to be located
  • change : in the “assist”, swap the menu Items checkboxes for clickable Ticks
  • change : in the “assist”, tweak styling and make more responsive to re-sizing
  • change : made compatible with Widget Customizer
  • Note : there is no separate release available for this version!

2.0.6

  • change : modified determination of current item to cope better with multiple occurences (still first-found, but within prioritised groups)
  • change : display of the upgrade notice in the plugins list has been replaced with a simple request to read the changelog before upgrading

2.0.5

  • bugfix : prevent PHP warnings of Undefined index/offset

2.0.4

  • bugfix : clearing the container field failed to remove the container from the output
  • addition : in the “assist”, added automatic selection of the shortcode text when it is clicked
  • addition : remove WordPress’s menu-item-has-children class (introduced in v3.7) when the filtered item no longer has children
  • change : tweaked styles and javascript in admin for WordPress v3.8

2.0.3

  • bugfix : missing global when enqueuing scripts and styles for admin

2.0.2

  • bugfix : the Include Ancestors option was not automatically including the Parent
  • bugfix : the “assist” was incorrectly calculating Depth Relative to Current Item when the current menu item was outside the scope of the Filtered items
  • behaviour change : only recognise the first “current” item found (used to allow subsequent “current” items to override any already encountered)

2.0.1

  • bugfix : an incorrect test for a specific-items filter prevented show-all producing any output

2.0.0

  • ! Possible Breaker ! The calculation of Start Level has been made consistent across the Show all and Children of filters : if you previously had a setup where you were filtering for the children of an item at level 2, with start level set to 4, there would have been no output because the immediate children (at level 3) were outside the start level. Now, there will be output, starting with the grand-children (at level 4).
  • ! Possible Breaker ! There is now deemed to be an artificial “root” item above the level 1 items, which mean that a Children of filter set to “Current Parent Item” or “Current Root Item” will no longer fail for a top-level “current menu item”. If you have the “no ancestor” fallback set then this change will have no impact (but you may now want to consider turning the fallback off?); if you don’t currently use the “no ancestor” fallback, then where there was previously no output there will now be some!
  • added new option : Items, a comma- or space-delimited list of menu item ids, as an alternative Filter
  • added new option : Depth Relative to Current Item to the Filter section (depth_rel_current=1 in the shortcode)
  • added new option : Must Contain Current Item to the Output section (contains_current=1 in the shortcode)
  • changed the widget’s “demo” facility to “assist” and brought it into WordPress admin, with full interactivity with the widget
  • refactored code

1.2.2

  • bugfix : fallback for Current Item with no children was failing because the parent’s children weren’t being picked out correctly

1.2.1

  • added some extra custom classes, when applicable : cmw-fellback-to-current & cmw-fellback-to-parent (on outer UL/OL) and cmw-the-included-parent, cmw-an-included-parent-sibling & cmw-an-included-ancestor (on relevant LIs)
  • corrected ‘show all from start level 1’ processing so that custom classes get applied and ‘Title from “Current” Item’ works (regardless of filter settings)
  • changed the defaults for new widgets such that only the Filter section is open by default; all the others are collapsed
  • in demo.html, added output of the shortcode applicable to the selections made
  • in demo.html, added a link to the documentation page
  • corrected 2 of the shortcode examples in the readme.txt, and made emulator (demo) available from the readme

1.2.0

  • added custom_menu_wizard shortcode, to run the widget from within content
  • moved the ‘no ancestor’ fallback into new Fallback collapsible section, and added a fallback for Current Item with no children
  • added an option allowing setting of title from current menu item’s title
  • fixed a bug with optgroups/options made available for the ‘Children of’ selector after the widget has been saved (also affected disabled fields and styling)
  • don’t include menus with no items
  • updated demo.html

1.1.0

  • added ‘Current Root Item’ and ‘Current Parent Item’ to the Children of filter
  • added Fallback to Current Item option, with subsidiary options for overriding a couple of Output options, as a means to enable Current Root & Current Parent to match a Current Item at root level
  • added an Output option to include both the parent item and the parent’s siblings (for a successful Children of filter)
  • added max-width style (100%) to the Children of SELECT in the widget options
  • added widget version to the admin js enqueuer
  • ignore/disable Hide Empty option for WP >= v3.6 (wp_nav_menu() now does it automatically)
  • included a stand-alone helper/demo html page
  • rebuilt the Children of SELECT in the widget options to cope with IE’s lack of OPTGROUP/OPTION styling
  • moved the setting of ‘disabled’ attributes on INPUTs/SELECTs from PHP into javascript

1.0.0

  • Initial release

No more updates, fails with PHP 8

By lausianne on August 5, 2023

The plugin fails with PHP 8 (breaking site), and there have been no updates for 5 years ...

Powerful and intelligent menu customizer !!!

By ugotta on July 12, 2020

Is the author still maintaining plug-ins? Although no mistakes were found. Compared with other custom menu plug-ins, this is the most powerful menu plug-in I have ever seen. I didn't understand the usage method for a long time, and almost missed it. In short, it is very powerful. I hope the plug-in author can update and adapt to the WP version

ok

By fpcing on April 10, 2019

很好用,希望有一个中文版本,I hope it could transla to chinese ,thanks

great

By matthias.wagner on November 29, 2018

does what it should ;)

Absolutely Great.

By CyberCobre on October 16, 2018

Does exactly what it should, how it should, leaving customizing the look to the webmaster. Very, very useful. You can place it anywhere you need a menu in your content, plus customize menus using the widget. Extremely versatile.

Powerful with lots of options, yet still a quick setup

By jjbbrr on September 22, 2018

This is a powerful plugin with excellent configurability. I searched for a long time to find a plugin that could do exactly what I wanted and this is the only one that fit the bill! It has a long range of options but the guide on the Wordpress.org page is very comprehensive and covered the settings I was looking for so it was very easy to setup.

Solved my problem for lengthy, tiered menu

By mlipenk on April 26, 2018

I have a large site with lengthy, often tiered menus. With some digging, this solved my basic problem of not always automatically displaying each and every sibling, or conversely parents and grandparents, at a particular level in the menu. Highly flexible, but also a bit overwhelming. However, the developer is quick to offer help if the documentation doesn't make sense for you. Many, many thanks to people willing to take the time to develop plugins like this.

Saves a ton of time and works great in 4.9 too

By Christina (carasmo) on February 25, 2018

I love this plugin! I have a variety of child menu items and they are not necessarily child pages. This plugin with a widget allows me to show just the child menu items of the current parent, and if there are no children, it won't output -- it's perfect. I just donated in the hopes that the developer will update the plugin so it is fresh and more people use it. Here's my settings: I am getting the current parent title by using the following php:
//* Get the menu parent id
//* https://pateason.com/wordpress-menu-top-most-parent-id/
function get_menu_parent_id( $menu_name ){
    
    if( ! isset( $menu_name ) ) :
      return "No menu name provided in arguments";
    endif;
    
    $menu_slug      = $menu_name;
    $locations      = get_nav_menu_locations();
    $menu_id        = $locations[$menu_slug];
    $post_id        = get_the_ID();
    $menu_items     = wp_get_nav_menu_items($menu_id);
    $parent_item_id = wp_filter_object_list($menu_items,array('object_id'=>$post_id),'and','menu_item_parent');
    $parent_item_id = array_shift( $parent_item_id );
    
    function check_for_parent( $parent_item_id, $menu_items ){
     
      $parent_post_id = wp_filter_object_list( $menu_items, array( 'ID' => $parent_item_id ), 'and', 'object_id' );
      $parent_item_id = wp_filter_object_list($menu_items,array('ID'=>$parent_item_id),'and','menu_item_parent');
      $parent_item_id = array_shift( $parent_item_id );
     
     if( $parent_item_id == '0' ) :
       
        $parent_post_id = array_shift($parent_post_id);
        return $parent_post_id;
      
      else:
       
        return check_for_parent( $parent_item_id, $menu_items );
     
      endif;
      
    } //check_for_parent();
    
    if( !empty( $parent_item_id ) ) :
      return check_for_parent($parent_item_id,$menu_items);
    else:
      return $post_id;
    endif;
}

//get Menu label by ID post or parentID from get_menu_parent_ID();
//https://stackoverflow.com/a/26591562/1004312
function get_menu_parent_by_id( $post_id, $menu ) {

    $menu_title = '';
    $nav = wp_get_nav_menu_items( $menu );

    foreach ( $nav as $item ) :

        if ( $post_id == $item->object_id ) :
            $menu_title = $item->post_title;
            break;
        endif;

    endforeach;

    return ( $menu_title !== '' ) ? $menu_title : get_the_title( $post_id );

}

//* allow shortcode in widget title
add_filter( 'widget_title', 'do_shortcode' );

//* menu parent title shortcode
function child_theme_parent_menu_title() {
 
 	$menu_location  = 'primary';
 	$menu_parent_id = get_menu_parent_id( $menu_location );
	return get_menu_parent_by_id( $menu_parent_id, $menu_location );

} 
add_shortcode( 'parent-menu-title', 'child_theme_parent_menu_title' );

Very satisfied with this plugin

By Avantart on August 30, 2017

I use the DIVI theme and there is no way to create any dynamic menues. As I have to create a menu like the former version of the site with another CMS, I was lost. But thanks to your widget I get the same logic, and I am very happy with that! My goal was to list all root items and the children of the current item ... now I can refine the output. Thank you!

Saves a lot of time

By kleinermann on August 16, 2017

I used to create different sidebar menus for different sections of the website. With this plugin i was able to reduce all this to one dynamic menu that only shows the relevant links for each section. This really saves me a lot of time. Thanks for this great plugin.
Try other plugins too!

Conditional Menus

This plugin enables you to set conditional menus per posts, pages, categories, archive pages, etc.

Try Demo More Details

WP Custom Admin Interface

With WP Custom Admin Interface you can easily customise the WordPress admin and login interfaces.

Try Demo More Details

Widget Importer & Exporter

Import and export your widgets.

Try Demo More Details
Author Site Author Site

Try Custom Menu Wizard Widget With InstaWP

Contact Sales

Reach out to us to explore how InstaWP can benefit your business.