=== Codepress Menu === Contributors: davidmosterd, tschutter Tags: wordpress, menu, navigation, nav, php, code Requires at least: 3.1 Tested up to: 3.4 Stable tag: 2.1.2 License: GPLv2 or later License URI: http://www.gnu.org/licenses/gpl-2.0.html A more flexible take on displaying a WordPress menu in your theme == Description == Uses the native [wp_nav_menu()](http://codex.wordpress.org/Function_Reference/wp_nav_menu) with a few more possibilities. No configuration required but it adds a few runtime parameters that can be used to tweak your menu. This will get the first sub-menu from the current branch and 2 levels beyond (menu + sub-menu + sub-menu): ` wp_nav_menu( array( 'level' => 2, 'depth' => 3 )); ` Show the whole current branch only: ` wp_nav_menu( array( 'level' => 1 )); ` Aimed on simple use on various use cases: ` // display first level in the header wp_nav_menu( array( 'depth' => 1 )); // display first sub-menu from the current branch somewhere else wp_nav_menu( array( 'depth' => 2, 'level' => 2 )); ` For those who like a some control on the CSS classes: * *sanitize* Keep only a few WordPress classes (li.current-menu-item, li.current-menu-parent, li.current-menu-ancestor) and add li.first and li.last. * *simple* Use even more simple classes (li.current, li.current-parent, li.current-ancestor) and add li.first and li.last. * *minimal* Same as simple, but without list.first and li.last because you target modern browsers only or use something like selectivizr * *false* Do nothing (default) Use the filter 'codepress_menu_filter_classes' to define your own class filter. ` wp_nav_menu( array( 'classes' => 'sanitize' )); ` == Upgrade Notice == = 2.1 = The changes from 2.0 to 2.1 are significant as it abandons the use of a custom function. A good step forward, but check the examples before you upgrade. == Installation == 1. Upload codepress-menu to the `/wp-content/plugins/` directory 1. Activate the plugin through the 'Plugins' menu in WordPress 1. Use wp_nav_menu() and it's new super-powers == Changelog == = 2.1.2 = * Now checks if the filters have not reduced the amount of items to zero. If so, act as wp_nav_menu and return false. * When a theme location is used in conjunction with the plugin, it now returns an empty string. = 2.1.1 = * 'sanitize' option is replaced by 'classes' and now defaults to doing nothing. Choosing 'simple' as option will result in what the default sanitize did in the 2.0 version. = 2.1 = * Now hooks into the native wp_nav_menu() and abandons the use of a custom function. * Extends the Walker_Nav_Menu class and most of it's filters and functions are used to keep as close to the WordPress core as possible. * You can no longer fetch an array of items and apply filters on it as you see fit. This functionality may return, but the focus of this version was on integration with wp_nav_menu(). = 2.0 = * Initial public release.