Filter
rpress_order_alerts_now
On this page
Filters the current Unix time used by the order alerts feature.
Runs in RPRESS_Order_Alerts::now(), which supplies the clock for the unattended-order escalation check. It exists so tests can move the clock. Returning a different timestamp changes which orders count as waiting too long.
Parameters#
| Parameter | Type | Description |
|---|---|---|
$value | int | Current Unix timestamp. |
Return value#
int. Unix timestamp to treat as now.
Example#
function my_order_alerts_now( $now ) {
return $now + HOUR_IN_SECONDS;
}
add_filter( 'rpress_order_alerts_now', 'my_order_alerts_now' );
Notes#
Intended for tests; do not shift the clock on a live store.
Source#
Applied in:
includes/features/order-alerts/loader.php(line 384), inRPRESS_Order_Alerts::now()
Was this page helpful?
