BP_Groups_Member::delete_request( int $user_id, int $group_id )

Delete an unconfirmed membership request, by user ID and group ID.

Description

Parameters

$user_id

(Required) ID of the user.

$group_id

(Required) ID of the group.

Return

(int) Number of records deleted.

Source

File: bp-groups/classes/class-bp-groups-member.php

	public static function delete_request( $user_id, $group_id ) {
		global $wpdb;

		if ( empty( $user_id ) )
			return false;

		$bp = buddypress();

		return $wpdb->query( $wpdb->prepare( "DELETE FROM {$bp->groups->table_name_members} WHERE user_id = %d AND group_id = %d AND is_confirmed = 0 AND inviter_id = 0 AND invite_sent = 0", $user_id, $group_id ) );
	}

Changelog

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