Filter
rpress_use_after_payment_actions
On this page
Filters whether the after-payment actions are deferred to a scheduled WP-Cron event.
By default (true) rpress_schedule_after_payment_action schedules a single event that later fires rpress_after_payment_actions. Return false to run the actions immediately inside the request that completes the payment, which is useful on sites where WP-Cron does not run.
Parameters#
| Parameter | Type | Description |
|---|---|---|
$use_cron | bool | True to schedule the actions, false to run them immediately. |
$payment_id | int | ID of the payment. |
Return value#
bool. Whether to use WP-Cron.
Example#
function my_run_after_payment_now( $use_cron, $payment_id ) {
return false;
}
add_filter( 'rpress_use_after_payment_actions', 'my_run_after_payment_now', 10, 2 );
Notes#
Evaluated in two places: when the purchase is completed, to decide whether to run the actions at once, and again when scheduling the event. Use a callback whose result does not change between the two calls.
Source#
Applied in:
includes/payments/actions.php(line 130), inrpress_complete_purchase()includes/payments/actions.php(line 159), inrpress_schedule_after_payment_action()
See also#
Was this page helpful?
