LLMS_Order::schedule_recurring_payment( string $next_payment_date = false, boolean $gmt = false )
Schedule recurring payment
Description Description
It will unschedule the next recurring payment action, if any, before scheduling.
Parameters Parameters
- $next_payment_date
-
(string) (Optional) Next payment date. If not provided it'll be retrieved using
$this->get_next_payment_due_date()
.Default value: false
- $gmt
-
(boolean) (Optional) Whether the provided
$next_payment_date
date is gmt. Default isfalse
. Only applies when the$next_payment_date
is provided.Default value: false
Return Return
(WP_Error|integer) WP_Error if the plan ended. Otherwise returns the return value of as_schedule_single_action
: the action's ID.
Source Source
File: includes/models/model.llms.order.php
2035 2036 2037 2038 2039 2040 2041 2042 2043 2044 2045 2046 2047 2048 2049 2050 2051 2052 2053 2054 2055 2056 2057 2058 2059 2060 2061 2062 2063 2064 2065 2066 2067 2068 2069 | * * Does nothing if no payments are scheduled * * @since 3.0.0 * @since 3.32.0 Update to use latest action-scheduler functions. * @since 4.6.0 Use ` $this ->get_next_scheduled_action_time()` to determine if the action is currently scheduled. * * @ return void */ public function unschedule_recurring_payment() { if ( $this ->get_next_scheduled_action_time( 'llms_charge_recurring_payment' ) ) { $action_args = $this ->get_action_args(); as_unschedule_action( 'llms_charge_recurring_payment' , $action_args ); /** * Fired after a recurring payment is unscheduled * * @since 5.2.0 * * @param LLMS_Order $order LLMS_Order instance. * @param int $date Timestamp of the recurring payment date UTC. * @param array $action_args Arguments passed to the scheduler. */ do_action( 'llms_charge_recurring_payment_unscheduled' , $this , $action_args ); } } /** * Schedule recurring payment * |
Expand full source code Collapse full source code View on GitHub
Changelog Changelog
Version | Description |
---|---|
5.2.0 | Introduced. |