bp_members_invitations_user_has_sent_invites( int $user_id )

Check whether a user has sent any community invitations.


Parameters Parameters

$user_id

(int) (Required) ID of user to check for invitations sent by. Defaults to the current user's ID.


Top ↑

Return Return

(bool) $invites True if user has sent invites.


Source Source

File: bp-members/bp-members-functions.php

function bp_members_invitations_user_has_sent_invites( $user_id = 0 ) {
	if ( 0 === $user_id ) {
		$user_id = bp_loggedin_user_id();
		if ( ! $user_id ) {
			return false;
		}
	}
	$invites_class = new BP_Members_Invitation_Manager();
	$args = array(
		'inviter_id' => $user_id,
	);
	return (bool) $invites_class->invitation_exists( $args );
}


Top ↑

Changelog Changelog

Changelog
Version Description
8.0.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

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