[memb_has_group_role]
Description
Checks the user's role in a BuddyPress group via BP_Groups_Member:
admin (group administrator), mod (moderator), or member. The
not attribute inverts the result.
When the BuddyPress Groups component is inactive, admins see a diagnostic notice and everyone else sees nothing.
Shortcode Examples
[memb_has_group_role group_id="5" role="admin"]Group admin tools[/memb_has_group_role]
Moderators or higher isn't implied, check explicitly:
[memb_has_group_role group_id="5" role="mod"]Moderator notes[/memb_has_group_role]
Shortcode Parameters
group_id
BuddyPress group ID. Required. Default: 0.
role
Role to require: admin, mod, or member. Required.
Default: ''.
user_id
User ID to check. Default: 0 (current user).
not
Inverts the result. Default: false.
Shortcode Attributes
| Attribute | Value |
|---|---|
| Conditional | Yes |
| Nestable | No |
| Accepts formatting | Yes |