Tribe__Tickets__RSVP::get_attendees_by_id( int $post_id, null $post_type = null )

Get attendees by id and associated post type or default to using $post_id


Parameters

$post_id

(int) (Required) The post ID.

$post_type

(null) (Optional) The post type.

Default value: null


Top ↑

Return

(array|mixed)


Top ↑

Source

File: src/Tribe/RSVP.php

	public function get_attendees_by_id( $post_id, $post_type = null ) {

		// RSVP Orders are a unique hash
		if ( ! is_numeric( $post_id ) ) {
			$post_type = 'rsvp_order_hash';
		}

		if ( ! $post_type ) {
			$post_type = get_post_type( $post_id );
		}

		switch ( $post_type ) {
			case $this->ticket_object:
				return $this->get_attendees_by_product_id( $post_id );

				break;
			case self::ATTENDEE_OBJECT:
				return $this->get_attendees_by_attendee_id( $post_id );

				break;
			case 'rsvp_order_hash':
				return $this->get_attendees_by_order_id( $post_id );

				break;
			default:
				return $this->get_attendees_by_post_id( $post_id );

				break;
		}

	}