Tribe__Tickets__REST__V1__Post_Repository::get_ticket_global_id_lineage( int $ticket_id, string $global_id = null )

Returns a ticket Global ID lineage.

If not set/updated for the attendee than the method will generate/update it.


Parameters

$ticket_id

(int) (Required) The ticket ID.

$global_id

(string) (Optional) The global ID.

Default value: null


Top ↑

Return

(array|bool)


Top ↑

Source

File: src/Tribe/REST/V1/Post_Repository.php

	public function get_ticket_global_id_lineage( $ticket_id, $global_id = null ) {
		if ( null === $global_id ) {
			$global_id = $this->get_ticket_global_id( $ticket_id );

			if ( false === $global_id ) {
				return false;
			}
		}

		$existing = get_post_meta( $ticket_id, $this->global_id_lineage_key, true );

		$new = ! empty( $existing )
			? array_unique( array_merge( (array) $existing, array( $global_id ) ) )
			: array( $global_id );

		if ( $new !== $existing ) {
			update_post_meta( $ticket_id, $this->global_id_lineage_key, $new );
		}

		return $new;
	}

Top ↑

Changelog

Changelog
Version Description
4.8 Introduced.