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
1631 1632 1633 1634 1635 1636 1637 1638 1639 1640 1641 1642 1643 1644 1645 1646 1647 1648 1649 1650 1651 1652 1653 1654 1655 1656 1657 1658 1659 1660 1661 1662 | * 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. |