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

Uninvite a user from a group.

Description

Functionally, this is equivalent to removing a user from a group.

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

1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
function groups_uninvite_user( $user_id, $group_id ) {
 
    if ( ! BP_Groups_Member::delete_invite( $user_id, $group_id ) )
        return false;
 
    /**
     * Fires after uninviting a user from a group.
     *
     * @since BuddyPress 1.0.0
     *
     * @param int $group_id ID of the group being uninvited from.
     * @param int $user_id  ID of the user being uninvited.
     */
    do_action( 'groups_uninvite_user', $group_id, $user_id );
 
    return true;
}

Changelog

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