BuddyDev

Search

Extending BuddyPress profile field visibility with Profile Type from BuddyBoss

  • Participant
    Level: Initiated
    Posts: 10
    Ben Bradley on #50610

    Hi Brajesh,

    This is a great tutorial here –
    https://buddydev.com/extending-buddypress-profile-field-visibility

    I’m looking to adapt your code to include a specific profile type from BuddyBoss.

    Is this the correct hook to use? – https://www.buddyboss.com/resources/reference/functions/bp_get_members_member_type_base/

    Is your code possible to use a profile type as well as the super admin, and the owner? All other users and roles will not show the field to them.

    Thanks.

  • Keymaster
    (BuddyDev Team)
    Posts: 24599
    Brajesh Singh on #50616

    Hi Ben,
    Welcome to BuddyDev.

    No, That is not the right code.
    you will need something like this.

    https://www.buddyboss.com/resources/reference/functions/bp_get_member_types/

    My code is an example to show case how can you add extra levels and then restrict by these.

    You can add whatever can be uniquely identified as level and then decide who can see it by restricting fields in the ‘bp_xprofile_get_hidden_field_types_for_user’ filter.

    Regards
    Brajesh

  • Participant
    Level: Initiated
    Posts: 10
    Ben Bradley on #50621
    This reply has been marked as private.
  • Keymaster
    (BuddyDev Team)
    Posts: 24599
    Brajesh Singh on #50625
    This reply has been marked as private.
  • Participant
    Level: Initiated
    Posts: 10
    Ben Bradley on #50633

    Thanks Brajesh!

  • Keymaster
    (BuddyDev Team)
    Posts: 24599
    Brajesh Singh on #50641

    You are welcome!

  • Participant
    Level: Initiated
    Posts: 10
    Ben Bradley on #50646
    This reply has been marked as private.
  • Keymaster
    (BuddyDev Team)
    Posts: 24599
    Brajesh Singh on #50666
    This reply has been marked as private.
  • Participant
    Level: Initiated
    Posts: 10
    Ben Bradley on #50670
    This reply has been marked as private.
  • Participant
    Level: Initiated
    Posts: 10
    Ben Bradley on #52959

    Hi Brajesh,

    The code doesn’t appear to be working 100% anymore, with some members able to have access to areas that they shouldn’t.

    We’ve found that re-saving the permalinks, seems to have temporarily fixed the issue, but this is only temporary.

    Can you provide any assistance with ensuring the code still works, please?

    Thanks.

You must be logged in to reply to this topic.

This topic is: not resolved