BP_Groups_Invitation_Manager::allow_invitation( $args )

Should this invitation be created?

Description

Parameters

$args.

(Required)

Return

(bool)

Source

File: bp-groups/classes/class-bp-groups-invitation-manager.php

156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
public function allow_invitation( $args ) {
    // Does the inviter have this capability?
    if ( ! bp_user_can( $args['inviter_id'], 'groups_send_invitation', array( 'group_id' => $args['item_id'] ) ) ) {
        return false;
    }
 
    // Is the invited user eligible to receive an invitation?
    if ( ! bp_user_can( $args['user_id'], 'groups_receive_invitation', array( 'group_id' => $args['item_id'] ) ) ) {
        return false;
    }
 
    // Prevent duplicated invitations.
    if ( groups_check_has_invite_from_user( $args['user_id'], $args['item_id'], $args['inviter_id'], 'all' ) ) {
        return false;
    }
 
    return true;
}

Changelog

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