Ticket #13378: 13378.diff
File 13378.diff, 1.7 KB (added by , 14 years ago) |
---|
-
wp-includes/nav-menu-template.php
192 192 function wp_nav_menu( $args = array() ) { 193 193 $defaults = array( 'menu' => '', 'container' => 'div', 'container_class' => '', 'menu_class' => 'menu', 'echo' => true, 194 194 'fallback_cb' => 'wp_page_menu', 'before' => '', 'after' => '', 'link_before' => '', 'link_after' => '', 195 'depth' => 0, 'walker' => '', 'context' => 'frontend' );195 'depth' => 0, 'walker' => '', 'context' => 'frontend', 'slot' => '' ); 196 196 197 197 $args = wp_parse_args( $args, $defaults ); 198 198 $args = apply_filters( 'wp_nav_menu_args', $args ); … … 201 201 // Get the nav menu 202 202 $menu = wp_get_nav_menu_object( $args->menu ); 203 203 204 if ( ! $menu && $slot ) { 205 $slots = get_option('nav_menu_slots'); 206 if ( isset($slots) && isset($slots[$slot]) ) 207 $menu = wp_get_nav_menu_object( $slots['slot'] ); 208 } 209 204 210 // If we couldn't find a menu based off the menu argument 205 211 // get the first menu that has items. 206 212 if ( ! $menu ) { -
wp-includes/nav-menu.php
62 62 } 63 63 64 64 /** 65 * Register nav menus for a theme. 66 * 67 * @since 3.0.0 68 * 69 * @param array Associative array of menu slot identifiers and descriptions. 70 */ 71 function register_nav_menus( $menus = array() ) { 72 global $_wp_registered_nav_menus; 73 74 add_theme_support( 'nav-menus' ); 75 76 $_wp_registered_nav_menus = $menus; 77 } 78 79 /** 65 80 * Determine whether the given ID is a nav menu item. 66 81 * 67 82 * @since 3.0.0