Tribe__Tickets__Tickets_View::count_rsvp_attendees( int $event_id, int|null $user_id = null )

Counts the amount of RSVP attendees.


Parameters

$event_id

(int) (Required) The Event ID we're checking.

$user_id

(int|null) (Optional) An Optional User ID.

Default value: null


Top ↑

Return

(int)


Top ↑

Source

File: src/Tribe/Tickets_View.php

	public function count_rsvp_attendees( $event_id, $user_id = null ) {
		if ( ! $user_id && null !== $user_id ) {
			// No attendees for this user.
			return 0;
		}

		/** @var Tribe__Tickets__RSVP $rsvp */
		$rsvp = tribe( 'tickets.rsvp' );

		// Get total attendees count for all users.
		if ( ! $user_id ) {
			return $rsvp->get_attendees_count( $event_id );
		}

		// Get total attendees count for this user.
		return $rsvp->get_attendees_count_by_user( $event_id, $user_id );
	}