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 ) {
	global $_wp_registered_nav_menus;

	if ( ! isset( $_wp_registered_nav_menus[ $location ] ) ) {
		return false;
	}

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

Link here