LLMS_Order::can_resubscribe()
Determines if the order can be resubscribed to.
Return Return
(bool)
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 );
}
Expand full source code Collapse full source code View on GitHub
Changelog Changelog
| Version | Description |
|---|---|
| 5.2.0 | Use strict type comparison. |
| 3.19.0 | Introduced. |