Tribe__Tickets__REST__V1__Attendee_Repository::format_item( int|WP_Post $id )

Returns the attendee in the REST API format.


Parameters

$id

(int|WP_Post) (Required) The attendee ID.


Top ↑

Return

(array|null) The attendee information in the REST API format or null if the attendee is invalid.


Top ↑

Source

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

	public function format_item( $id ) {
		/**
		 * For the time being we use **another** repository to format
		 * the tickets objects to the REST API format.
		 * If this implementation gets a thumbs-up this class and the
		 * `Tribe__Tickets__REST__V1__Post_Repository` should be merged.
		 */

		/** @var Tribe__Tickets__REST__V1__Post_Repository $repository */
		$repository = tribe( 'tickets.rest-v1.repository' );

		$formatted = $repository->get_attendee_data( $id );

		return $formatted instanceof WP_Error ? null : $formatted;
	}

Top ↑

Changelog

Changelog
Version Description
4.8 Introduced.