Tribe__Tickets__Status__Manager::get_status_options( $commerce )
Return an array of Statuses for a Commerce with label and stock attributes
Contents
Parameters
- $commerce
-
(Required) string a string of the Commerce System to get statuses from
Return
(array) an array of statues with label and stock attributes
Source
File: src/Tribe/Status/Manager.php
public function get_status_options( $commerce ) {
static $status_options;
$commerce = $this->check_for_full_provider_name( $commerce );
if ( ! isset( $this->statuses[ $commerce ]->statuses ) ) {
return [];
}
if ( ! empty( $status_options[ $commerce ] ) ) {
return $status_options[ $commerce ];
}
$filtered_statuses = $this->statuses[ $commerce ]->statuses;
foreach ( $filtered_statuses as $status ) {
$status_options[ $commerce ][ $status->provider_name ] = [
'label' => __( $status->name, 'event-tickets' ),
'decrease_stock_by' => empty( $status->count_completed ) ? 0 : 1,
];
}
return $status_options[ $commerce ];
}
Changelog
| Version | Description |
|---|---|
| 4.10 | Introduced. |