library/Helper/Navigation.php
public function mainMenuAuto()
    {
        $markup = null;

        $menu = false;
        $classes = array('nav');

        if (!$menu || !is_string($menu) || (isset($_GET['menu_cache']) && $_GET['menu_cache'] == 'false')) {
            if (!empty(get_field('nav_primary_align', 'option'))) {
                $classes[] = 'nav-' . get_field('nav_primary_align', 'option');
            }

            $menu = new \Municipio\Helper\NavigationTree(array(
                'theme_location' => 'main-menu',
                'include_top_level' => true,
                'render' => get_field('nav_primary_render', 'option'),
                'depth' => 1,
                'sublevel' => get_field('nav_primariy_second_level', 'option'),
                'classes' => implode(' ', apply_filters('Municipio/main_menu_classes', $classes)) . ' ' . apply_filters('Municipio/desktop_menu_breakpoint', 'hidden-xs hidden-sm')
            ));

            if (isset($menu) && $menu->itemCount() > 0) {
                $markup = apply_filters('Municipio/main_menu/items', $menu->render(false));
            }

            return $markup;
        }

        return $menu;
    }
public function mainMenuAuto()
    {
        $markup = null;

        $menu = false;
        $classes = array('nav');

        if (!$menu || !is_string($menu) || (isset($_GET['menu_cache']) && $_GET['menu_cache'] == 'false')) {
            if (!empty(get_field('nav_primary_align', 'option'))) {
                $classes[] = 'nav-' . get_field('nav_primary_align', 'option');
            }

            $menu = new \Municipio\Helper\NavigationTree(array(
                'theme_location' => 'main-menu',
                'include_top_level' => true,
                'render' => get_field('nav_primary_render', 'option'),
                'depth' => 1,
                'sublevel' => get_field('nav_primariy_second_level', 'option'),
                'classes' => implode(' ', apply_filters('Municipio/main_menu_classes', $classes)) . ' ' . apply_filters('Municipio/desktop_menu_breakpoint', 'hidden-xs hidden-sm')
            ));

            if (isset($menu) && $menu->itemCount() > 0) {
                $markup = apply_filters('Municipio/main_menu/items', $menu->render(false));
            }

            return $markup;
        }

        return $menu;
    }
public function mainMenuAuto ( ) { $ markup = null ; $ menu = false ; $ classes = array ( 'nav' ) ; if ( ! $ menu || ! is_string ( $ menu ) || ( isset ( $ _GET [ 'menu_cache' ] ) && $ _GET [ 'menu_cache' ] == 'false' ) ) { if ( ! empty ( get_field ( 'nav_primary_align' , 'option' ) ) ) { $ classes [ ] = 'nav-' . get_field ( 'nav_primary_align' , 'option' ) ; } $ menu = new \ Municipio \ Helper \ NavigationTree ( array ( 'theme_location' => 'main-menu' , 'include_top_level' => true , 'render' => get_field ( 'nav_primary_render' , 'option' ) , 'depth' => 1 , 'sublevel' => get_field ( 'nav_primariy_second_level' , 'option' ) , 'classes' => implode ( ' ' , apply_filters ( 'Municipio/main_menu_classes' , $ classes ) ) . ' ' . apply_filters ( 'Municipio/desktop_menu_breakpoint' , 'hidden-xs hidden-sm' ) ) ) ; if ( isset ( $ menu ) && $ menu -> itemCount ( ) > 0 ) { $ markup = apply_filters ( 'Municipio/main_menu/items' , $ menu -> render ( false ) ) ; } return $ markup ; } return $ menu ; }
Get navigation tree main menu
@return string Markup
Get navigation tree main menu