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
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
| 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.