Skip to content
Docs
Get RestroPress

Filter

rpress_order_alerts_now

Updated
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#

ParameterTypeDescription
$valueintCurrent 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), in RPRESS_Order_Alerts::now()
Was this page helpful?