llms_get_order_statuses( string $order_type = 'any' )
Retrieve an array of registered and available LifterLMS Order Post Statuses.
Parameters Parameters
- $order_type
-
(string) (Optional) Filter statuses which are specific to the supplied order type, defaults to any statuses.
Default value: 'any'
Return Return
(array[])
Source Source
File: includes/functions/llms.functions.order.php
* @since 3.0.0
* @since 3.19.0 Unknown.
*
* @param string $order_type Filter statuses which are specific to the supplied order type, defaults to any statuses.
* @return array[]
*/
function llms_get_order_statuses( $order_type = 'any' ) {
$statuses = wp_list_pluck( LLMS_Post_Types::get_order_statuses(), 'label' );
// Remove types depending on order type.
switch ( $order_type ) {
case 'recurring':
unset( $statuses['llms-completed'] );
break;
case 'single':
unset( $statuses['llms-active'] );
unset( $statuses['llms-expired'] );
unset( $statuses['llms-on-hold'] );
unset( $statuses['llms-pending-cancel'] );
break;
}
/**
* Filters the order statuses.
*
* @since Unknown.
*
Expand full source code Collapse full source code View on GitHub
Changelog Changelog
| Version | Description |
|---|---|
| 3.19.0 | Unknown. |
| 3.0.0 | Introduced. |