Tribe__Tickets__Tickets::get_event_ticket_provider( int $event_id = null )
Get the saved or default ticket provider, if active.
Contents
Will return False if there is a saved provider that is currently not active. Example: If provider is WooCommerce Ticket but ETP is inactive, will return False.
See also
Parameters
- $event_id
-
(int) (Optional) The post ID of the event to which the ticket is attached.
Default value: null
Return
(string|false) The ticket object class name, or false if not active.
Source
File: src/Tribe/Tickets.php
public static function get_event_ticket_provider( $event_id = null ) {
// if post ID is set, and a value has been saved, return the saved value
if ( ! empty( $event_id ) ) {
$saved = get_post_meta( $event_id, tribe( 'tickets.handler' )->key_provider_field, true );
if ( ! empty( $saved ) ) {
return $saved;
}
}
// otherwise just return the default
return self::get_default_module();
}
Changelog
| Version | Description |
|---|---|
| 4.7 | |
| 4.12.3 | Introduced. |