LLMS_Order::maybe_schedule_payment( $recalc = true )
Schedules the next payment due on a recurring order
Description Description
Can be called without consequence on a single payment order. Will always unschedule the scheduled action (if one exists) before scheduling another.
Return Return
(void)
Source Source
File: includes/models/model.llms.order.php
* Determine if the order is recurring or singular * * @since 3.0.0 * * @return boolean True if recurring, false if not. */ public function is_recurring() { return $this->get( 'order_type' ) === 'recurring'; } /** * Schedule access expiration * * @since 3.19.0 * @since 3.32.0 Update to use latest action-scheduler functions. * * @return void */ public function maybe_schedule_expiration() { // Get expiration date based on setting. $expires = $this->get_access_expiration_date( 'U' ); // Will return a timestamp or "Lifetime Access as a string". if ( is_numeric( $expires ) ) { $this->unschedule_expiration(); as_schedule_single_action( $expires, 'llms_access_plan_expiration', $this->get_action_args() ); } } /**
Expand full source code Collapse full source code View on GitHub
Changelog Changelog
Version | Description |
---|---|
5.2.0 | Move scheduling recurring payment into a proper method. |
4.7.0 | Add plan_ended metadata when a plan ends. |
3.32.0 | Update to use latest action-scheduler functions. |
3.0.0 | Introduced. |