Tribe__Tickets__Data_API::get_providers_for_post( int $post_id )
Get the Providers for a Post
Contents
Parameters
- $post_id
-
(int) (Required) the id of the post
Return
(array) an array of providers
Source
File: src/Tribe/Data_API.php
public function get_providers_for_post( $post_id ) {
$providers = [];
$modules = $this->ticket_class;
foreach ( $modules as $class => $module ) {
$obj = call_user_func( [ $class, 'get_instance' ] );
$provider_tickets = $obj->get_tickets( $post_id );
if ( ! empty( $provider_tickets ) ) {
$providers[ $module['slug'] ] = $class;
}
}
return $providers;
}
Changelog
| Version | Description |
|---|---|
| 4.11.0 | Introduced. |