Tribe__Tickets__Tickets::get_ticket_prices( array $prices, int $post_id )
Queries ticketing providers to establish the range of tickets/pricepoints for the specified event and ensures those costs are included in the $costs array.
Contents
Parameters
- $prices
-
(array) (Required)
- $post_id
-
(int) (Required)
Return
(array)
Source
File: src/Tribe/Tickets.php
public function get_ticket_prices( array $prices, $post_id ) {
// Iterate through all tickets from all providers
foreach ( self::get_all_event_tickets( $post_id ) as $ticket ) {
// No need to add the pricepoint if it is already in the array
if ( in_array( $ticket->price, $prices ) ) {
continue;
}
// An empty price property can be ignored (but do add if the price is explicitly set to zero)
elseif ( isset( $ticket->price ) && is_numeric( $ticket->price ) ) {
$prices[] = $ticket->price;
}
}
return $prices;
}