LLMS_Post_Types::get_order_statuses()

Retrieve all registered order statuses


Return Return

(array)


Top ↑

Source Source

File: includes/class.llms.post-types.php

	public static function get_order_statuses() {

		$statuses = array(

			// Single payment only.
			'llms-completed'      => array(
				'label'       => _x( 'Completed', 'Order status', 'lifterlms' ),
				'label_count' => _n_noop( 'Completed <span class="count">(%s)</span>', 'Completed <span class="count">(%s)</span>', 'lifterlms' ),
			),

			// Recurring only.
			'llms-active'         => array(
				'label'       => _x( 'Active', 'Order status', 'lifterlms' ),
				'label_count' => _n_noop( 'Active <span class="count">(%s)</span>', 'Active <span class="count">(%s)</span>', 'lifterlms' ),
			),
			'llms-expired'        => array(
				'label'       => _x( 'Expired', 'Order status', 'lifterlms' ),
				'label_count' => _n_noop( 'Expired <span class="count">(%s)</span>', 'Expired <span class="count">(%s)</span>', 'lifterlms' ),
			),
			'llms-on-hold'        => array(
				'label'       => _x( 'On Hold', 'Order status', 'lifterlms' ),
				'label_count' => _n_noop( 'On Hold <span class="count">(%s)</span>', 'On Hold <span class="count">(%s)</span>', 'lifterlms' ),
			),
			'llms-pending-cancel' => array(
				'label'       => _x( 'Pending Cancellation', 'Order status', 'lifterlms' ),
				'label_count' => _n_noop( 'Pending Cancellation <span class="count">(%s)</span>', 'Pending Cancellation <span class="count">(%s)</span>', 'lifterlms' ),
			),

			// Shared.
			'llms-pending'        => array(
				'label'       => _x( 'Pending Payment', 'Order status', 'lifterlms' ),
				'label_count' => _n_noop( 'Pending Payment <span class="count">(%s)</span>', 'Pending Payment <span class="count">(%s)</span>', 'lifterlms' ),
			),
			'llms-cancelled'      => array(
				'label'       => _x( 'Cancelled', 'Order status', 'lifterlms' ),
				'label_count' => _n_noop( 'Cancelled <span class="count">(%s)</span>', 'Cancelled <span class="count">(%s)</span>', 'lifterlms' ),
			),
			'llms-refunded'       => array(
				'label'       => _x( 'Refunded', 'Order status', 'lifterlms' ),
				'label_count' => _n_noop( 'Refunded <span class="count">(%s)</span>', 'Refunded <span class="count">(%s)</span>', 'lifterlms' ),
			),
			'llms-failed'         => array(
				'label'       => _x( 'Failed', 'Order status', 'lifterlms' ),
				'label_count' => _n_noop( 'Failed <span class="count">(%s)</span>', 'Failed <span class="count">(%s)</span>', 'lifterlms' ),
			),

		);

		$defaults = array(
			'public'                    => true,
			'exclude_from_search'       => false,
			'show_in_admin_all_list'    => true,
			'show_in_admin_status_list' => true,
		);

		foreach ( $statuses as &$status ) {
			$status = array_merge( $status, $defaults );
		}

		/**
		 * Filter the list of order statuses that will be registered with WordPress.
		 *
		 * @since 3.19.0
		 *
		 * @param array[] $statuses Array of post status arrays.
		 */
		return apply_filters( 'lifterlms_register_order_post_statuses', $statuses );

	}


Top ↑

Changelog Changelog

Changelog
Version Description
3.19.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

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