BuddyDev

Search

Hide Custom Tab base on user role

Tagged: 

  • Participant
    Level: Initiated
    Posts: 3
    Blessing Joshua on #50684

    Please I need help putting together my custom Tabs.
    Is it possible to display Tabs base on WordPress user role? Like example, I want to display a certain tab for profile owner only. I want the tab to display only for the profile owner, I don’t want other users to see it.

    Again I want display the tabs base on user role. Like I want to create one tab for WordPress Subscriber user role capability and another tab for Editor user role capability, and no other user can see this tab except the user that has the profile.

  • Keymaster
    (BuddyDev Team)
    Posts: 24308
    Brajesh Singh on #50686

    Hi,
    Welcome to BuddyDev.

    Thank you for the question.

    If you are referring to custom tab created by you, then I don’t see any issue. How are you creating tabs?

    Regards
    Brajesh

  • Participant
    Level: Initiated
    Posts: 3
    Blessing Joshua on #50688

    I have never created Tabs I just want to learn and create

  • Keymaster
    (BuddyDev Team)
    Posts: 24308
    Brajesh Singh on #50689

    Hi Joshua,
    You can either try looking at BuddyPress source for for bp_core_new_nav_item
    Here is their docs too

    
    https://codex.buddypress.org/developer/function-examples/core/bp_core_new_nav_item/
    

    Regards
    Brajesh

  • Participant
    Level: Initiated
    Posts: 3
    Blessing Joshua on #50690

    I have this plugin call BP custom menu, can I use it to achieve it

  • Keymaster
    (BuddyDev Team)
    Posts: 24308
    Brajesh Singh on #50691

    Hi,
    The plugin should allow you to use page as tab. I haven’t checked it recently, so not sure if it allows restricting by roles.
    I will suggest giving that a try.

    Regards
    Brajesh

  • Participant
    Level: Initiated
    Posts: 3
    Blessing Joshua on #50694

    It doesn’t hide tabs based on user role. I have tried it but now options for that. Please help me find a way.

  • Keymaster
    (BuddyDev Team)
    Posts: 24308
    Brajesh Singh on #50695

    Hi,
    You can use our Profile tabs creator pro(paid plugin) to achieve it.
    https://buddydev.com/plugins/buddypress-user-profile-tabs-creator-pro/

    Regards
    Brajesh

You must be logged in to reply to this topic.

This topic is: not resolved