LLMS_Order::can_resubscribe()

Determines if the order can be resubscribed to.


Return Return

(bool)


Top ↑

Source Source

File: includes/models/model.llms.order.php

	public function can_resubscribe() {

		$can_resubscribe = false;

		if ( $this->is_recurring() ) {

			/**
			 * Filters the order statuses from which an order can be reactivated.
			 *
			 * @since 7.0.0
			 *
			 * @param string[] $allowed_statuses The list of allowed order statuses.
			 */
			$allowed_statuses = apply_filters(
				'llms_order_status_can_resubscribe_from',
				array(
					'llms-on-hold',
					'llms-pending',
					'llms-pending-cancel',
				)
			);
			$can_resubscribe  = in_array( $this->get( 'status' ), $allowed_statuses, true );

		}

		/**
		 * Determines whether or not a user can resubscribe to an inactive recurring payment order.
		 *
		 * @since 3.19.0
		 *
		 * @param boolean    $can_resubscribe Whether or not a user can resubscribe.
		 * @param LLMS_Order $order           The order object.
		 */
		return apply_filters( 'llms_order_can_resubscribe', $can_resubscribe, $this );

	}


Top ↑

Changelog Changelog

Changelog
Version Description
5.2.0 Use strict type comparison.
3.19.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

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