Tribe__Tickets__Tickets_Handler::get_event_shared_tickets( $post = null )
Get an array list of shared capacity tickets for an event.
Contents
Parameters
-
(int|object) (Required) (null) $post Post or Post ID tickets are attached to
Return
(array) List of shared capacity tickets for an event.
Source
File: src/Tribe/Tickets_Handler.php
public function get_event_shared_tickets( $post = null ) {
$post_id = Tribe__Main::post_id_helper( $post );
$tickets = Tribe__Tickets__Tickets::get_event_tickets( $post_id );
$ticket_list = array();
if ( empty( $tickets ) ) {
return $ticket_list;
}
foreach ( $tickets as $ticket ) {
$stock_mode = $ticket->global_stock_mode();
if ( empty( $stock_mode ) || Tribe__Tickets__Global_Stock::OWN_STOCK_MODE === $stock_mode ) {
continue;
}
// Failsafe - should not include unlimited tickets
if ( $this->is_unlimited_ticket( $ticket ) ) {
continue;
}
$ticket_list[] = $ticket;
}
return $ticket_list;
}
Changelog
| Version | Description |
|---|---|
| 4.6 | Introduced. |