Tickets_View::get_post_attendees_by_purchaser( int $post_id, int|null $user_id )

Groups PayPal ticket attendees by purchaser name/email


Parameters

$post_id

(int) (Required) The post ID it relates to

$user_id

(int|null) (Required) An optional user ID


Top ↑

Return

(array) Array with the tickets attendees grouped by purchaser name/email


Top ↑

Source

File: src/Tickets/Commerce/Tickets_View.php

	public function get_post_attendees_by_purchaser( $post_id, $user_id ) {
		$attendees = $this->get_post_ticket_attendees( $post_id, $user_id );

		if ( ! $attendees ) {
			return array();
		}

		$attendee_groups = array();
		foreach ( $attendees as $attendee ) {
			$key = $attendee['purchaser_name'] . '::' . $attendee['purchaser_email'];

			if ( ! isset( $attendee_groups[ $key ] ) ) {
				$attendee_groups[ $key ] = array();
			}

			$attendee_groups[ $key ][] = $attendee;
		}

		return $attendee_groups;
	}

Top ↑

Changelog

Changelog
Version Description
5.1.9 Introduced.