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'


Top ↑

Return Return

(array[])


Top ↑

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.
	 *


Top ↑

Changelog Changelog

Changelog
Version Description
3.19.0 Unknown.
3.0.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.