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
This commit is contained in:
nacin 2010-05-03 22:03:52 +00:00
parent 039b8aa6e5
commit 856f478a9e
1 changed files with 4 additions and 0 deletions

View File

@ -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 = ''; $nav_menu = '';
$items = ''; $items = '';
$container_allowedtags = apply_filters( 'wp_nav_menu_container_allowedtags', array( 'div', 'p', 'nav' ) ); $container_allowedtags = apply_filters( 'wp_nav_menu_container_allowedtags', array( 'div', 'p', 'nav' ) );