Filter
rpress_reminder_check_order
On this page
Filters the reminder decision for an order.
Runs at the end of rpress_reminder_check_order(), only when the order passed all built-in checks (so the state is send or wait). The array has state (send, wait, sent, skip or disabled), reason, reminder_at and service_at. Set state to skip with a reason to block the reminder for specific orders.
Parameters#
| Parameter | Type | Description |
|---|---|---|
$result | array | Decision with keys state, reason, reminder_at and service_at. |
$payment_id | int | Order ID. |
$now | int | Unix time of the check. |
Return value#
array. Decision array.
Example#
function my_reminder_check( $result, $payment_id, $now ) {
if ( get_post_meta( $payment_id, 'my_no_reminder', true ) ) {
$result['state'] = 'skip';
$result['reason'] = 'custom_block';
}
return $result;
}
add_filter( 'rpress_reminder_check_order', 'my_reminder_check', 10, 3 );
Notes#
Orders that fail an earlier built-in check return without passing through this filter.
Source#
Applied in:
includes/features/reminder-emails/functions.php(line 186), inrpress_reminder_check_order()
See also#
Was this page helpful?
