Event_Modifier::include_venue_data( array $data, TECTickets_Wallet_PlusPassesApple_WalletPass $pass )
Add the Venue data into the Apple Pass back data.
Contents
Parameters
- $data
-
(array) (Required) The Apple Pass data.
- $pass
-
(TECTickets_Wallet_PlusPassesApple_WalletPass) (Required) The Apple Pass object.
Return
(array) Modified pass data.
Source
File: src/Events/Integrations/Plugins/Tickets_Wallet_Plus/Passes/Apple_Wallet/Event_Modifier.php
public function include_venue_data( array $data, Pass $pass ): array {
// Bail if `tribe_events` CPT is not enabled to have tickets.
if ( ! in_array( \Tribe__Events__Main::POSTTYPE, tribe( 'tickets.main' )->post_types(), true ) ) {
return $data;
}
// Bail if there is no attendee.
if ( ! $pass->attendee_exists() ) {
return $data;
}
$event_id = $pass->get_event_id();
// Get the event.
$event = tribe_get_event( $event_id );
if ( empty( $event->venues->count() ) ) {
return $data;
}
$venue = $event->venues[0];
$data['auxiliary'][] = [
'key' => 'event_venue',
'label' => esc_html__( 'Venue', 'the-events-calendar' ),
'value' => $venue->post_title,
];
return $data;
}
Changelog
| Version | Description |
|---|---|
| 6.2.8 | Introduced. |