Tribe__Tickets__Validator__Base::is_attendee_id( int $attendee_id )

Whether the value is the post id of an existing attendee or not.


Parameters

$attendee_id

(int) (Required)


Top ↑

Return

(bool)


Top ↑

Source

File: src/Tribe/Validator/Base.php

	public function is_attendee_id( $attendee_id ) {
		if ( empty( $attendee_id ) ) {
			return false;
		}

		// get ticket provider
		$ticket_type = tribe( 'tickets.data_api' )->detect_by_id( $attendee_id );

		//get ticket
		$ticket = get_post( $attendee_id );

		return ! empty( $ticket_type['post_type'] ) && ! empty( $ticket ) &&  $ticket_type['post_type'] === $ticket->post_type;
	}

Top ↑

Changelog

Changelog
Version Description
4.8.0 Introduced.