mirror of
https://github.com/WordPress/WordPress.git
synced 2025-02-22 07:22:01 +01:00
Don't call wp_get_nav_menu_items() twice.
git-svn-id: http://svn.automattic.com/wordpress/trunk@14529 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
66502fba1a
commit
0c99110a58
@ -206,7 +206,7 @@ function wp_nav_menu( $args = array() ) {
|
||||
if ( ! $menu ) {
|
||||
$menus = wp_get_nav_menus();
|
||||
foreach ( $menus as $menu_maybe ) {
|
||||
if ( wp_get_nav_menu_items($menu_maybe->term_id) ) {
|
||||
if ( $menu_items = wp_get_nav_menu_items($menu_maybe->term_id) ) {
|
||||
$menu = $menu_maybe;
|
||||
break;
|
||||
}
|
||||
@ -214,7 +214,7 @@ function wp_nav_menu( $args = array() ) {
|
||||
}
|
||||
|
||||
// If the menu exists, get its items.
|
||||
if ( $menu && ! is_wp_error($menu) )
|
||||
if ( $menu && ! is_wp_error($menu) && !isset($menu_items) )
|
||||
$menu_items = wp_get_nav_menu_items( $menu->term_id );
|
||||
|
||||
// If no menu was found or if the menu has no items, call the fallback_cb
|
||||
|
Loading…
Reference in New Issue
Block a user