Tribe__Tickets__Editor__Meta::register_tickets_list_in_rest( mixed $value, int $post_id, string $meta_key, bool $single )
Make sure the value of the “virtual” meta is up to date with the correct ticket values as can be modified by removing or adding a plugin outside of the blocks editor the ticket can be added by React if is part of the diff of non created blocks
Contents
Parameters
- $value
-
(mixed) (Required)
- $post_id
-
(int) (Required)
- $meta_key
-
(string) (Required)
- $single
-
(bool) (Required)
Return
(array)
Source
File: src/Tribe/Editor/Meta.php
public function register_tickets_list_in_rest( $value, $post_id, $meta_key, $single ) {
if ( '_tribe_tickets_list' !== $meta_key ) {
return $value;
}
$tickets = Tribe__Tickets__Tickets::get_event_tickets( $post_id );
$list_of_tickets = array();
foreach ( $tickets as $ticket ) {
if ( ! ( $ticket instanceof Tribe__Tickets__Ticket_Object ) || 'Tribe__Tickets__RSVP' === $ticket->provider_class ) {
continue;
}
$list_of_tickets[] = $ticket->ID;
}
return $list_of_tickets;
}
Changelog
| Version | Description |
|---|---|
| 4.9 | Introduced. |