Home Forums ACF PRO ACF Location "Nav Menu" Reply To: ACF Location "Nav Menu"

  • Nice plugin, good job @happiness 🙂

    Anyway we can use filters like this example:

    add_filter('wp_nav_menu_items', 'my_wp_nav_menu_items', 10, 2);
    function my_wp_nav_menu_items( $items, $args ) {
        $menu = wp_get_nav_menu_object($args->menu);
        $menuSlug = $menu->slug;
        if ($menuSlug == 'hamburger-menu') {
            if (is_user_logged_in()) {
                $items .= '<li id="menu-item-logout" class="menu-item menu-item-logout"><a href="'. wp_logout_url(home_url()) .'">LOGOUT</a></li>';
            } else {
                $items .= '<li id="menu-item-login" class="menu-item menu-item-login"><a href="'. home_url() .'/logowanie">LOG IN</a></li>';
        return $items;

    This is an answer for related question “How to add items to an ACF Nav Menu?”
    Hope it helps for future questions about it.