From f01af5fefdf93aa9e52c82575f4156a33eae16e5 Mon Sep 17 00:00:00 2001 From: Andrew 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: https://develop.svn.wordpress.org/trunk@14415 602fd350-edb4-49c9-b593-d223f7449a82 --- 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' ) );