BuddyDev

Using BuddyPress Member Types as Profile Field Visibility Levels

Recently, I was asked about using BuddyPress Member Types as profile field visibility level. It seemed like a good question to me and I am going to share the code to make it work.

Before we start, The goal of visibility is to set the visibility of the profile field data for other users not the profile owner. You are allowing profile owners to choose who can see their data. If you want to hide certain fields from user for editing purpose, you should use the "Member Types" option on the profile field add/edit screen.

Now, that we are clear about visibility, let us explore the possibility. If you don't know how to extend visibilities, you may want to take a look at my post Extending BuddyPress Profile Field Visibility.

Step 1:- Adding BuddyPress member type names as visibility level

As soon as we are done with it, the new levels will be available to select from the list of visibility as shown below.

That looks good but we are not done yet. It only lists the member types as visibilities and lets user select them.

Step 2:- Hiding fields from other users based on the field visibility

And it will hide the profile field based on member type as visibility level.

Have fun.

Comments are closed.