Whether a registered nav menu location has a menu assigned to it.

Signature

has_nav_menu( $location )
location
 (string) Menu location identifier.

Return

(boolean) Whether location has a menu.

Source

function has_nav_menu( $location ) {
	$locations = get_nav_menu_locations();
	return ( ! empty( $locations[ $location ] ) );
}
WP Trac GitHub

Link here