Today, I am presenting you the most flexible, re-imagined, BuddyPress Friendship restrictions. If you were wondering how to limit users from one role to be friend of only some other selected roles, you can do it now.
The BuddyPress Friendship Restrictions empowers you to:-
- Put global restrictions on Friendship
- Enable custom restrictions by role or member type
- Based on your selection, you can override all restrictions for the given role or member type.
Here are a list of things you can do(all are optional) in the global settings.
General Options(Global settings):-
- Restrict who can be requested friendship(you can limit to one or more roles).
- Restrict who can send friendship requests(you can limit to one or more role).
- Rate limit(throttle) the friendship request. How many can be sent during certain period.
- Set a limit on how may friends a user can have(maximum limit)
- Disable unfriending(Users can not cancel friendship).
- Enable advance restrictions(By role or member type).
If you enable the advance restrictions, you can override almost everything for each role or member type.
Here is what you can do for each role.
Role based settings:-
- You can enable to override the global restrictions. If you don't, the global restrictions will apply.
- Enable/Disable restrictions for sending request.
- You can set a limit or remove the limit on number of friends.
- You can enable/disable requests restrictions for this role.
- You can select who(which roles) can send them friendship requests.
- You can select which roles the user(having this role) can send friendship requests.
- You can select which other roles can be friend for user with this role
Member Types based settings:-
It has the same functionality as role based settings. You can select if you want to enable custom restrictions for a member type and customize the settings.
Question:- If a member has more that one role, which settings will apply?
Answer:- The setting which is most permissive will be applied. For example, if role A allows 5 friends and role B allows 10, then 10 friends will be allowed.