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

Delete a pending group membership request.

Description

Parameters

$membership_id

(Required) Deprecated 1.3.5

$user_id

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

$group_id

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

Return

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

Source

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

function groups_delete_membership_request( $membership_id, $user_id = 0, $group_id = 0 ) {
	if ( !empty( $user_id ) && !empty( $group_id ) )
		$membership = new BP_Groups_Member( $user_id, $group_id );
	else
		$membership = new BP_Groups_Member( false, false, $membership_id );

	if ( ! BP_Groups_Member::delete_request( $membership->user_id, $membership->group_id ) )
		return false;

	return $membership;
}

Changelog

Changelog
Version Description
BuddyPress 1.2.0 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.