Tribe__Tickets__REST__V1__Post_Repository::get_attendee_global_id_lineage( int $attendee_id, string $global_id = null )

Returns an attendee Global ID lineage.

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


Parameters

$attendee_id

(int) (Required) The attendee ID.

$global_id

(string) (Optional) The global ID.

Default value: null


Top ↑

Return

(array|bool) The attendee Global ID lineage or false on failure.


Top ↑

Source

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

	public function get_attendee_global_id_lineage( $attendee_id, $global_id = null ) {
		if ( null === $global_id ) {
			$global_id = $this->get_attendee_global_id( $attendee_id );
		}

		$existing = get_post_meta( $attendee_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( $attendee_id, $this->global_id_lineage_key, $new );
		}

		return $new;
	}

Top ↑

Changelog

Changelog
Version Description
4.8 Introduced.