From 856f478a9e6803679ee56e84ecfb6f02ee1f2da6 Mon Sep 17 00:00:00 2001 From: nacin Date: Mon, 3 May 2010 22:03:52 +0000 Subject: [PATCH] Bail when there is neither a menu, or a fallback. props ptahdunbar, fixes #13006. git-svn-id: http://svn.automattic.com/wordpress/trunk@14415 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/nav-menu-template.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/wp-includes/nav-menu-template.php b/wp-includes/nav-menu-template.php index 899513c968..7ef335a2ac 100644 --- a/wp-includes/nav-menu-template.php +++ b/wp-includes/nav-menu-template.php @@ -220,6 +220,10 @@ function wp_nav_menu( $args = array() ) { } } + // If no fallback function was specified and the menu doesn't exists, bail. + if ( !$menu || is_wp_error($menu) ) + return false; + $nav_menu = ''; $items = ''; $container_allowedtags = apply_filters( 'wp_nav_menu_container_allowedtags', array( 'div', 'p', 'nav' ) );