Allow assigning an empty menu to a location. fixes #13787
git-svn-id: http://svn.automattic.com/wordpress/trunk@15184 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
15e9538874
commit
f46ce5e7bc
|
@ -162,8 +162,8 @@ function wp_nav_menu( $args = array() ) {
|
||||||
if ( $menu && ! is_wp_error($menu) && !isset($menu_items) )
|
if ( $menu && ! is_wp_error($menu) && !isset($menu_items) )
|
||||||
$menu_items = wp_get_nav_menu_items( $menu->term_id );
|
$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 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) ) )
|
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 ) ) )
|
&& ( function_exists($args->fallback_cb) || is_callable( $args->fallback_cb ) ) )
|
||||||
return call_user_func( $args->fallback_cb, (array) $args );
|
return call_user_func( $args->fallback_cb, (array) $args );
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue