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

1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
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.