groups_unban_member( int $user_id, int $group_id )

Unban a member from a group.

Description

Parameters

$user_id

(Required) ID of the user.

$group_id

(Required) ID of the group.

Return

(bool) True on success, false on failure.

Source

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

2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
function groups_unban_member( $user_id, $group_id ) {
 
    if ( ! bp_is_item_admin() )
        return false;
 
    $member = new BP_Groups_Member( $user_id, $group_id );
 
    /**
     * Fires before the unbanning of a member from a group.
     *
     * @since BuddyPress 1.0.0
     *
     * @param int $group_id ID of the group being unbanned from.
     * @param int $user_id  ID of the user being unbanned.
     */
    do_action( 'groups_unban_member', $group_id, $user_id );
 
    return $member->unban();
}

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.