BP_Nouveau_Group_Invite_Query::build_exclude_args()

Exclude group members from the user query as it’s not needed to invite members to join the group.

Description

Source

File: bp-templates/bp-nouveau/includes/groups/classes.php

41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
public function build_exclude_args() {
    $this->query_vars = wp_parse_args( $this->query_vars, array(
        'group_id'     => 0,
        'is_confirmed' => true,
    ) );
 
    $group_member_ids = $this->get_group_member_ids();
 
    // We want to get users that are already members of the group
    $type = 'exclude';
 
    // We want to get invited users who did not confirmed yet
    if ( false === $this->query_vars['is_confirmed'] ) {
        $type = 'include';
    }
 
    // We have to exclude users if set on $this->query_vars_raw["exclude"] parameter
    if ( ! empty( $this->query_vars_raw["exclude"] ) ) {
        $group_member_ids = array_merge( $group_member_ids, explode(',', $this->query_vars_raw["exclude"] ) );
    }
 
    if ( ! empty( $group_member_ids ) ) {
        $this->query_vars[ $type ] = $group_member_ids;
    }
}

Changelog

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