BP_Groups_Group::get_invites( int $user_id, int $group_id, int|null $sent = null )

Get IDs of users with outstanding invites to a given group from a specified user.


Parameters Parameters

$user_id

(int) (Required) ID of the inviting user.

$group_id

(int) (Required) ID of the group.

$sent

(int|null) (Optional) Query for a specific invite sent status. If 0, this will query for users that haven't had an invite sent to them yet. If 1, this will query for users that have had an invite sent to them. If null, no invite status will queried. Default: null.

Default value: null


Top ↑

Return Return

(array) IDs of users who have been invited to the group by the user but have not yet accepted.


Source Source

File: bp-groups/classes/class-bp-groups-group.php

	public static function get_invites( $user_id, $group_id, $sent = null ) {
		if ( 0 === $sent ) {
			$sent_arg = 'draft';
		} else if ( 1 === $sent ) {
			$sent_arg = 'sent';
		} else {
			$sent_arg = 'all';
		}

		return groups_get_invites( array(
			'item_id'     => $group_id,
			'inviter_id'  => $user_id,
			'invite_sent' => $sent_arg,
			'fields'      => 'user_ids',
		) );
	}


Top ↑

Changelog Changelog

Changelog
Version Description
2.9.0 Added $sent as a parameter.
1.6.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

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