• Resolved eliac7

    (@eliac7)


    Hello,
    I have successfully created two custom tabs, let’s say A and B. C and D are the roles. I want the C role to own the A tab and the D role to own the B tab. If I just change privacy from Ultimate Member settings, under Appearance and menu profile, it won’t make what I need. What I need, is “A” field can be seen from C and D role BUT doesn’t own it D role.

    Hopes I made myself clear.

    Thanks in advance!

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter eliac7

    (@eliac7)

    I found the way out. If anyone else is trying to figure out, here is my snippet

    function um_mycustomtab_add_tab($tabs)
    {
    
        $hide_from_roles = array('um_custom_role_1', 'administrator');
        if (is_user_logged_in() && !in_array(um_user('role'), $hide_from_roles)) {
            $tabs['test'] = array(
                'name' => 'Test',
                'custom' => true,
    
            );
        }
    
        if (!isset(UM()->options()->options['profile_tab_' . 'test'])) {
            UM()->options()->update('profile_tab_' . 'test', true);
        }
        return $tabs;
    }
    • This reply was modified 4 years, 4 months ago by eliac7.
    Plugin Contributor Champ Camba

    (@champsupertramp)

    Hi @eliac7

    Thanks for letting us know how you resolve the issue.

    I am closing this thread now.

    Regards,

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Assign custom tab on specific roles’ is closed to new replies.