llms_get_possible_order_statuses( LLMS_Order $order )
Get the possible statuses of a given order.
Parameters Parameters
- $order
-
(LLMS_Order) (Required) The LLMS_Order instance.
Return Return
(array[])
Source Source
File: includes/functions/llms.functions.order.php
*
* @since 5.4.0
*
* @param LLMS_Order $order The LLMS_Order instance.
* @return array[]
*/
function llms_get_possible_order_statuses( $order ) {
$is_recurring = $order->is_recurring();
$statuses = llms_get_order_statuses( $is_recurring ? 'recurring' : 'single' );
// Limit the possible status for recurring orders whose product ID doesn't exist anymore.
if ( $is_recurring && ! llms_get_post( $order->get( 'product_id' ) ) ) {
unset( $statuses['llms-active'] );
unset( $statuses['llms-on-hold'] );
unset( $statuses['llms-pending'] );
Expand full source code Collapse full source code View on GitHub
Changelog Changelog
| Version | Description |
|---|---|
| 5.4.0 | Introduced. |