groups_reject_invite( int $user_id, int $group_id, int $inviter_id = false )

Reject a group invitation.

Description

Parameters

$user_id

(Required) ID of the user.

$group_id

(Required) ID of the group.

$inviter_id

(Optional) ID of the inviter.

Default value: false

Return

(bool) True on success, false on failure.

Source

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

function groups_reject_invite( $user_id, $group_id ) {
	if ( ! BP_Groups_Member::delete_invite( $user_id, $group_id ) )
		return false;

	/**
	 * Fires after a user rejects a group invitation.
	 *
	 * @since BuddyPress 1.0.0
	 *
	 * @param int $user_id  ID of the user rejecting the invite.
	 * @param int $group_id ID of the group being rejected.
	 */
	do_action( 'groups_reject_invite', $user_id, $group_id );

	return true;
}

Changelog

Changelog
Version Description
BuddyPress 5.0.0 The $inviter_id arg was added. BuddyPress 5.0.0 The $inviter_id arg was added.
BuddyPress 1.0.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.