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

Counts the Amount of Tickets 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_ticket_attendees( $event_id, $user_id = null ) {
		if ( ! $user_id && null !== $user_id ) {
			// No attendees for this user.
			return 0;
		}

		$args = [
			'by' => [
				'provider__not_in' => 'rsvp',
			],
		];

		// Get total attendees count for this user.
		if ( $user_id ) {
			$args['by']['user'] = $user_id;
		}

		return Tribe__Tickets__Tickets::get_event_attendees_count( $event_id, $args );
	}