Changeset 14620 for trunk/wp-includes/nav-menu-template.php
- Timestamp:
- 05/14/2010 06:20:30 AM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/nav-menu-template.php
r14611 r14620 194 194 $defaults = array( 'menu' => '', 'container' => 'div', 'container_class' => '', 'menu_class' => 'menu', 'echo' => true, 195 195 'fallback_cb' => 'wp_page_menu', 'before' => '', 'after' => '', 'link_before' => '', 'link_after' => '', 196 'depth' => 0, 'walker' => '', 'context' => 'frontend', 'theme_ menu' => '' );196 'depth' => 0, 'walker' => '', 'context' => 'frontend', 'theme_location' => '' ); 197 197 198 198 $args = wp_parse_args( $args, $defaults ); … … 200 200 $args = (object) $args; 201 201 202 // Get the nav menu 202 // Get the nav menu based on the requested menu 203 203 $menu = wp_get_nav_menu_object( $args->menu ); 204 204 205 if ( ! $menu && $slot ) { 206 $slots = get_nav_menu_slots(); 207 if ( isset($slots) && isset($slots['theme_menu']) ) 208 $menu = wp_get_nav_menu_object( $slots['theme_menu'] ); 209 } 210 211 // If we couldn't find a menu based off the menu argument 212 // get the first menu that has items. 205 // Get the nav menu based on the theme_location 206 if ( ! $menu && $args->theme_location && ( $locations = get_nav_menu_locations() ) && isset( $locations[ $args->theme_location ] ) ) 207 $menu = wp_get_nav_menu_object( $locations[ $args->theme_location ] ); 208 209 // get the first menu that has items if we still can't find a menu 213 210 if ( ! $menu ) { 214 211 $menus = wp_get_nav_menus();
Note: See TracChangeset
for help on using the changeset viewer.