'topbar', 'mobile_menu' => 'mobile', 'main_menu' => 'header' ); $mobile_menu_opt = hu_get_option( 'header_mobile_menu_layout' ); //SETUP THE MOBILE MENU LOCATION //Since v3.3.8, the default mobile menu is the topbar //The idea is to avoid as much as possible having an empty mobile menu for new users. //If no menu has been assigned to the topbar location yet, let's loop on all possible menu in a specific order to assign a menu anyway. $mobile_menu_location = '_not_set_'; $has_menu_assigned = false; if ( array_key_exists( $mobile_menu_opt, $location_map ) && has_nav_menu( $location_map[ $mobile_menu_opt ] ) ) { $mobile_menu_location = $location_map[ $mobile_menu_opt ]; $has_menu_assigned = true; } else { $match = false; foreach ( $location_map as $user_opt => $theme_loc ) { if ( has_nav_menu( $theme_loc ) && ! $match ) { $match = true; $mobile_menu_location = $theme_loc; } } } //SETUP THE FALLBACK CB $fallback_cb = ''; switch( $mobile_menu_opt ) { case 'main_menu' : $fallback_cb = apply_filters( 'hu_header_menu_fallback_cb', '' ); break; case 'top_menu' : case 'mobile_menu' : $fallback_cb = apply_filters( 'hu_topbar_menu_fallback_cb', ( ! is_multisite() && hu_is_checked( "default-menu-header" ) ) ? 'hu_page_menu' : '' );//set to 'hu_page_menu' on prevdem break; } $fallback_cb = apply_filters( 'hu_mobile_menu_fallback_cb', $fallback_cb );//set to 'hu_page_menu' on prevdem $mobile_menu_classes = array( 'nav-container', 'group', 'mobile-menu', 'no_stick' != hu_normalize_stick_menu_opt( hu_get_option( 'header-mobile-sticky' ) ) ? 'mobile-sticky' : '', $has_menu_assigned ? '' : 'no-menu-assigned' ); $we_have_a_menu = has_nav_menu( $mobile_menu_location ) || ! empty( $fallback_cb ); ?>