BuddyDev

Search

Allow users to hide some tabs from profile

Tagged: 

  • Participant
    Level: Initiated
    Posts: 18
    Nitin Shah on #42848

    I want to add a couple of extra tabs to user profile where users can add details about emotional support groups they run and courses they offer but not every member on my buddypress site will be offering these services. So is it possible to allow them the option whether or not do they wish to show these options on their profile tabs. So probably I can have two yes/no Xprofile fields with questions:
    1. Do you conduct support groups? and
    2. Do you offer courses?

    If the user answers yes then the relevant profile tab is shown on their profile.

    Any suggestion on how to do this?

  • Keymaster
    (BuddyDev Team)
    Posts: 24211
    Brajesh Singh on #42851

    Hi Nitin,
    Thank you for the question.

    This is doable but there is pre-made solution for this. Most probably you are adding tabs using custom code. All you need there is to check using xprofile_get_field_data( $field_name_or_id, $user_id ), the user preference and add tab accordingly.

    Regards
    Brajesh

  • Participant
    Level: Initiated
    Posts: 18
    Nitin Shah on #42860

    Thank you, that makes sense. I am also planning to purchase the BuddyPress profile tab creator pro, will this also be possible via the same?

  • Keymaster
    (BuddyDev Team)
    Posts: 24211
    Brajesh Singh on #42861

    Hi Nitin,
    You are welcome.

    At the moment, The profile tabs plugin does not support conditionally disabling based on user preference(Admins can do that for roles).

    So, custom code will still be required for removing it.

    Regards
    Brajesh

You must be logged in to reply to this topic.

This topic is: not resolved