groups_accept_all_pending_membership_requests( int $group_id )
Accept all pending membership requests to a group.
Description
Parameters
- $group_id
-
(Required) ID of the group.
Return
(bool) True on success, false on failure.
Source
File: bp-groups/bp-groups-functions.php
function groups_accept_all_pending_membership_requests( $group_id ) { $user_ids = BP_Groups_Member::get_all_membership_request_user_ids( $group_id ); if ( !$user_ids ) return false; foreach ( (array) $user_ids as $user_id ) groups_accept_membership_request( false, $user_id, $group_id ); /** * Fires after the acceptance of all pending membership requests to a group. * * @since BuddyPress 1.0.2 * * @param int $group_id ID of the group whose pending memberships were accepted. */ do_action( 'groups_accept_all_pending_membership_requests', $group_id ); return true; }
Changelog
Version | Description |
---|---|
BuddyPress 1.0.2 | Introduced. |
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.