Tribe__Tickets__Editor__Blocks__Tickets::get_tickets( int $post_id )
Get all tickets for event/post, other than RSVP type because they’re presented in a separate block.
Contents
Parameters
- $post_id
-
(int) (Required) Post ID.
Return
(array)
Source
File: src/Tribe/Editor/Blocks/Tickets.php
public function get_tickets( $post_id ) {
$all_tickets = Tribe__Tickets__Tickets::get_all_event_tickets( $post_id );
if ( ! $all_tickets ) {
return array();
}
$tickets = array();
foreach ( $all_tickets as $ticket ) {
if ( 'Tribe__Tickets__RSVP' === $ticket->provider_class ) {
continue;
}
$tickets[] = $ticket;
}
return $tickets;
}
Changelog
| Version | Description |
|---|---|
| 4.9 | Introduced. |