groups_delete_membership_request( int $membership_id, int $user_id, int $group_id )

Delete a pending group membership request.


Parameters Parameters

$membership_id

(int) (Required) Deprecated 5.0.0.

$user_id

(int) (Optional) ID of the user who requested membership. Provide this value along with $group_id to override $membership_id.

$group_id

(int) (Optional) ID of the group to which membership is being requested. Provide this value along with $user_id to override $membership_id.


Top ↑

Return Return

(false|BP_Groups_Member) True on success, false on failure.


Source Source

File: bp-groups/bp-groups-functions.php

function groups_delete_membership_request( $membership_id, $user_id = 0, $group_id = 0 ) {
	if ( ! empty( $membership_id ) ){
		/* translators: 1: method name. 2: file name. */
		_deprecated_argument( __METHOD__, '5.0.0', sprintf( __( 'Argument `membership_id` passed to %1$s  is deprecated. See the inline documentation at %2$s for more details.', 'buddypress' ), __METHOD__, __FILE__ ) );
	}

	if ( empty( $user_id ) || empty( $group_id ) ) {
		return false;
	}

	$invites_class = new BP_Groups_Invitation_Manager();
	$success       = $invites_class->delete_requests( array(
		'user_id' => $user_id,
		'item_id' => $group_id
	) );

	return $success;
}


Top ↑

Changelog Changelog

Changelog
Version Description
1.2.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.