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
This commit is contained in:
Andrew Nacin 2010-05-03 22:03:52 +00:00
parent eee631b773
commit f01af5fefd
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 = '';
$items = '';
$container_allowedtags = apply_filters( 'wp_nav_menu_container_allowedtags', array( 'div', 'p', 'nav' ) );