- Author was Featured
- Has been a member for 4-5 years
- Author had a Free File of the Month
- Sold between 100 000 and 250 000 dollars
- Bought between 10 and 49 items
- Europe
- Exclusive Author
- Referred between 200 and 499 users
I don’t know why but some of the wordpress menus always seem to display all pages if you have not assigned any menu to them.
Is there a way to prevent this behavior? Display nothing if no menu is assigned?
I use my own function to detect if user have create the menu or not
function wip_have_custom_menu( $loc ){
$locations = get_nav_menu_locations();
$menu = "";
if( isset( $locations[ $loc ] ) ) {
$menu = wp_get_nav_menu_object( $locations[ $loc ] );
}
if($menu)
return true;
else
return false;
}
use it in the file, eg the theme location is ‘primary’
if ( !wip_have_custom_menu('primary') ):
//echo some message, so user can create the menu
else:
$nav_args = array(
'container' => '',
'menu_class' => 'menu',
'menu_id' => 'eqnav',
'echo' => true,
'depth' => 0,
'theme_location' => 'primary'
);
wp_nav_menu($nav_args);
endif;
hope it help 
good luck
- Sold between 250 000 and 1 000 000 dollars
- Community Moderator
- Author was Featured
- Item was Featured
- Bought between 50 and 99 items
- Referred between 1000 and 1999 users
- Has been a member for 3-4 years
- Repeatedly Helped protect Envato Marketplaces against copyright violations
The wp_nav_menu function has fallback functionality built in. You can assign any function you want via the fallback_cb parameter. You can set it to false to disable the fallback. I assume that would print nothing 
- Author was Featured
- Has been a member for 4-5 years
- Author had a Free File of the Month
- Sold between 100 000 and 250 000 dollars
- Bought between 10 and 49 items
- Europe
- Exclusive Author
- Referred between 200 and 499 users
I think I was looking for this function:
http://codex.wordpress.org/Function_Reference/has_nav_menu