Three new endpoints have been added in the JSON API User Plus plugin for BuddyPress Groups component to check if the user is member, mod or admin of any given BP group.
These are the three new endpoints:
1. groups_is_user_admin
Check whether a user is an admin of a given group.
Returns (int|bool)
ID of the membership if the user is admin, otherwise false.
Parameters (2)
- 1.user_id (int)
- ID of the user.
- 2.group_id (int)
- ID of the group.
2. groups_is_user_mod
Check whether a user is a mod of a given group
Returns (int|bool)
ID of the membership if the user is mod, otherwise false.
Parameters (2)
- 1.user_id (int)
- ID of the user.
- 2.group_id (int)
- ID of the group.
3. groups_is_user_member
Check whether a user is a member of a given group.
Returns (int|bool)
ID of the membership if the user is member, otherwise false.
Parameters (2)
- 1.user_id (int)
- ID of the user.
- 2.group_id (int)
- ID of the group.