=== 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.1 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 == Adds better options to the native [wp_nav_menu()](http://codex.wordpress.org/Function_Reference/wp_nav_menu). No configuration required. **Usage** This will get the first sub-menu from the current branch and 2 levels of children (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 to be simple 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 over the CSS classes: ` wp_nav_menu( array( 'classes' => 'sanitize' )); ` * **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 li.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. == 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.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.