• Resolved eliac7

    (@eliac7)


    Hello,
    I have created two extra profile tabs and I have two different user roles. Each role wants to have a different tab as default. Is there any hook that I could specify let’s say A role to have X profile tab as default and B role have the Y profile tab as default?

    Thanks in advance!

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Contributor Champ Camba

    (@champsupertramp)

    Hi @eliac7

    You can try this code snippet below. It changes the default Profile tab by User Role:

    add_filter("um_get_option_filter__profile_menu_default_tab","um_012621_profile_menu_default_tab");
    function um_012621_profile_menu_default_tab( $value ){
    
        $user_role = um_user("role");
        if( $user_role == 'subscriber' ){
            return 'posts';
        }
        elseif( $user_role == 'administrator' ){
            return 'comments';
        }
        
        return $value;
    }

    Regards,

    Thread Starter eliac7

    (@eliac7)

    Thanks a lot, Champ! Appreciate it.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Hook for default profile tab’ is closed to new replies.