WordPress.org

Make WordPress Core

Changeset 14529


Ignore:
Timestamp:
05/10/10 01:11:04 (4 years ago)
Author:
ryan
Message:

Don't call wp_get_nav_menu_items() twice.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/nav-menu-template.php

    r14471 r14529  
    207207        $menus = wp_get_nav_menus(); 
    208208        foreach ( $menus as $menu_maybe ) { 
    209             if ( wp_get_nav_menu_items($menu_maybe->term_id) ) { 
     209            if ( $menu_items = wp_get_nav_menu_items($menu_maybe->term_id) ) { 
    210210                $menu = $menu_maybe; 
    211211                break; 
     
    215215 
    216216    // If the menu exists, get its items. 
    217     if ( $menu && ! is_wp_error($menu) ) 
     217    if ( $menu && ! is_wp_error($menu) && !isset($menu_items) ) 
    218218        $menu_items = wp_get_nav_menu_items( $menu->term_id ); 
    219219 
Note: See TracChangeset for help on using the changeset viewer.