Contents
groups_is_user_admin( int $user_id, int $group_id )
Check whether a user is an admin of a given group.
Description
Parameters
- $user_id
-
(Required) ID of the user.
- $group_id
-
(Required) ID of the group.
Return
(int|bool) ID of the membership if the user is admin, otherwise false.
Source
File: bp-groups/bp-groups-functions.php
function groups_is_user_admin( $user_id, $group_id ) { $is_admin = false; $user_groups = bp_get_user_groups( $user_id, array( 'is_admin' => true, ) ); if ( isset( $user_groups[ $group_id ] ) ) { $is_admin = $user_groups[ $group_id ]->id; } return $is_admin; }
Changelog
Version | Description |
---|---|
BuddyPress 1.0.0 | Introduced. |
Related
Uses
Uses | Description |
---|---|
bp-groups/bp-groups-functions.php: bp_get_user_groups() |
Get a list of groups of which the specified user is a member. |
Used By | Description |
---|---|
bp-media/classes/class-bp-rest-media-endpoint.php: BP_REST_Media_Endpoint::bp_rest_check_privacy_restriction() |
Check user access based on the privacy for the single Media. |
bp-media/classes/class-bp-rest-media-albums-endpoint.php: BP_REST_Media_Albums_Endpoint::bp_rest_check_album_privacy_restriction() |
Check user access based on the privacy for the single album. |
bp-document/classes/class-bp-rest-document-folder-endpoint.php: BP_REST_Document_Folder_Endpoint::bp_rest_check_folder_privacy_restriction() |
Check user access based on the privacy for the single folder. |
bp-document/classes/class-bp-rest-document-endpoint.php: BP_REST_Document_Endpoint::bp_rest_check_privacy_restriction() |
Check user access based on the privacy for the single document. |
bp-document/bp-document-template.php: bp_document_user_can_edit() |
Determine if the current user can edit an document item. |
bp-document/bp-document-functions.php: bp_document_user_can_manage_folder() |
Check user have a permission to manage the folder. |
bp-document/bp-document-functions.php: bp_document_user_can_manage_document() |
Check user have a permission to manage the document. |
bp-media/bp-media-template.php: bp_media_user_can_delete() |
Determine if the current user can delete an media item. |
bp-media/bp-media-functions.php: bp_media_user_can_manage_album() |
Check user have a permission to manage the album. |
bp-media/bp-media-functions.php: bp_media_user_can_manage_media() |
Check user have a permission to manage the media. |
bp-groups/bp-groups-functions.php: groups_can_user_manage_document() |
Check whether a user is allowed to manage document in a given group. |
bp-groups/bp-groups-functions.php: groups_can_user_manage_messages() |
Check whether a user is allowed to manage messages in a given group. |
bp-groups/bp-groups-functions.php: groups_can_user_manage_folders() |
Check whether a user is allowed to manage albums in a given group. |
bp-groups/classes/class-bp-rest-groups-endpoint.php: BP_REST_Groups_Endpoint::prepare_item_for_response() |
Prepares group data for return as an object. |
bp-groups/classes/class-bp-rest-groups-endpoint.php: BP_REST_Groups_Endpoint::bp_get_group_member_section_title() |
Return the group member section header while in the groups members loop. |
bp-groups/classes/class-bp-rest-group-membership-request-endpoint.php: BP_REST_Group_Membership_Request_Endpoint::update_item_permissions_check() |
Checks if a given request has access to accept a group membership request. |
bp-groups/classes/class-bp-rest-group-membership-request-endpoint.php: BP_REST_Group_Membership_Request_Endpoint::delete_item_permissions_check() |
Checks if a given request has access to reject a group membership request. |
bp-groups/classes/class-bp-rest-group-membership-endpoint.php: BP_REST_Group_Membership_Endpoint::update_item_permissions_check() |
Check if a given request has access to update a group member. |
bp-groups/classes/class-bp-rest-group-membership-endpoint.php: BP_REST_Group_Membership_Endpoint::delete_item_permissions_check() |
Check if a given request has access to delete a group member. |
bp-groups/classes/class-bp-rest-group-membership-endpoint.php: BP_REST_Group_Membership_Endpoint::prepare_item_for_response() |
Prepares group member data for return as an object. |
bp-groups/classes/class-bp-rest-group-membership-request-endpoint.php: BP_REST_Group_Membership_Request_Endpoint::get_items_permissions_check() |
Check if a given request has access to fetch group membership requests. |
bp-groups/classes/class-bp-rest-group-membership-request-endpoint.php: BP_REST_Group_Membership_Request_Endpoint::get_item_permissions_check() |
Check if a given request has access to fetch group membership request. |
bp-groups/classes/class-bp-rest-attachments-group-avatar-endpoint.php: BP_REST_Attachments_Group_Avatar_Endpoint::create_item_permissions_check() |
Checks if a given request has access to upload a group avatar. |
bp-groups/classes/class-bp-rest-group-invites-endpoint.php: BP_REST_Group_Invites_Endpoint::delete_item_permissions_check() |
Check if a given request has access to delete a group invitation. |
bp-forums/classes/class-bp-rest-forums-endpoint.php: BP_REST_Forums_Endpoint::can_access_content() |
Check current access permission. |
bp-activity/classes/class-bp-rest-activity-endpoint.php: BP_REST_Activity_Endpoint::show_hidden() |
Show hidden activity? |
bp-forums/functions.php: bbp_group_is_admin() |
Is the current user an admin of the current group |
bp-forums/replies/functions.php: bbp_adjust_forum_role_labels() |
Change forum role labels to conform to BuddyBoss Platform naming conventions |
bp-groups/classes/class-bp-group-extension.php: BP_Group_Extension::user_meets_access_condition() |
Check whether the current user meets an access condition. |
bp-groups/classes/class-bp-groups-member.php: BP_Groups_Member::delete_all_for_user() |
Delete all group membership information for the specified user. |
bp-groups/classes/class-bp-groups-component.php: BP_Groups_Component::setup_globals() |
Set up component global data. |
bp-groups/classes/class-bp-groups-component.php: BP_Groups_Component::setup_nav() |
Set up component navigation. |
bp-groups/bp-groups-functions.php: bp_get_user_group_role_title() |
Get the member’s group role |
bp-groups/bp-groups-functions.php: groups_can_user_manage_albums() |
Check whether a user is allowed to manage albums in a given group. |
bp-groups/bp-groups-functions.php: groups_is_user_allowed_posting() |
Check whether a user is allowed to post in a given group. |
bp-groups/bp-groups-functions.php: groups_can_user_manage_media() |
Check whether a user is allowed to manage media in a given group. |
bp-groups/bp-groups-functions.php: groups_leave_group() |
Remove a user from a group. |
bp-groups/bp-groups-template.php: bp_get_group_member_section_title() |
Return the group member section header while in the groups members loop. |
bp-groups/bp-groups-template.php: bp_get_group_join_button() |
Return button to join a group. |
bp-groups/bp-groups-filters.php: bp_groups_user_can_filter() |
Filter the bp_user_can value to determine what the user can do with regards to a specific group. |
bp-groups/bp-groups-filters.php: bp_groups_allow_mods_to_delete_activity() |
Filter the bp_activity_user_can_delete value to allow moderators to delete activities of a group. |
bp-groups/bp-groups-notifications.php: groups_notification_promoted_member() |
Notify group member they have been promoted. |
bp-friends/bp-friends-functions.php: friends_get_friends_invite_list() |
Get a list of friends that a user can invite into this group. |
bp-friends/classes/class-bp-friends-friendship.php: BP_Friends_Friendship::get_invitable_friend_count() |
Get a count of a user’s friends who can be invited to a given group. |
bp-integrations/learndash/buddypress/Courses.php: Courses::showUserProgress() |
Output user course progress html |
bp-integrations/learndash/buddypress/Reports.php: Reports::forceOwnReportResults() |
Only allow non admin/mod to view his own reports |
bp-integrations/learndash/buddypress/Reports.php: Reports::removeUserFilterIfStudent() |
Remove user filter is nond admin/mod are viewing reports tab |
bp-core/bp-core-attachments.php: bp_attachments_current_user_can() |
Check the current user’s capability to edit an avatar for a given object. |
Questions?
We're always happy to help with code or other questions you might have! Search our developer docs, contact support, or connect with our sales team.