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.


Source Source

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

	public function build_exclude_args() {
		$this->query_vars = bp_parse_args(
			$this->query_vars,
			array(
				'group_id'     => 0,
				'is_confirmed' => true,
			),
			'nouveau_group_invite_query_exlude_args'
		);

		$group_member_ids = $this->get_group_member_ids();

		/**
		 * We want to exclude users who are already members or who have been
		 * invited by **any** of the group members to join it.
		 */
		$type = 'exclude';

		// We want to get the invited users who did not confirmed yet.
		if ( false === $this->query_vars['is_confirmed'] ) {
			$type = 'include';
		}

		if ( ! empty( $group_member_ids ) ) {
			$this->query_vars[ $type ] = $group_member_ids;
		}
	}


Top ↑

Changelog Changelog

Changelog
Version Description
3.0.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.