From 64eb8f71599ea4ced48c50669ec009809a47d7ad Mon Sep 17 00:00:00 2001 From: Ryan Boren Date: Wed, 9 Jun 2010 22:05:27 +0000 Subject: [PATCH] Allow assigning an empty menu to a location. fixes #13787 git-svn-id: https://develop.svn.wordpress.org/trunk@15184 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-includes/nav-menu-template.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/wp-includes/nav-menu-template.php b/wp-includes/nav-menu-template.php index 8889c50c6d..616c29475a 100644 --- a/wp-includes/nav-menu-template.php +++ b/wp-includes/nav-menu-template.php @@ -162,8 +162,8 @@ function wp_nav_menu( $args = array() ) { 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 if it exists - if ( ( !$menu || is_wp_error($menu) || ( isset($menu_items) && empty($menu_items) ) ) + // If no menu was found or if the menu has no items and no location was requested, call the fallback_cb if it exists + if ( ( !$menu || is_wp_error($menu) || ( isset($menu_items) && empty($menu_items) && !$args->theme_location ) ) && ( function_exists($args->fallback_cb) || is_callable( $args->fallback_cb ) ) ) return call_user_func( $args->fallback_cb, (array) $args );