Skip to content
Docs
Get RestroPress

Filter

rpress_live_orders_lookahead

Updated
On this page

Filters how far ahead, in seconds, scheduled orders appear on the Live Orders board.

Orders for a later date only show on the Live Orders board when their service time is within this window of the current time, so tomorrow's pre-orders stay off today's board while an order placed just before midnight for a slot after midnight is not hidden. The order alerts feature uses the same value to decide whether an order is too far away to trigger alerts.

Parameters#

ParameterTypeDescription
$lookaheadintLookahead in seconds. Defaults to 3 * HOUR_IN_SECONDS.

Return value#

int. Lookahead in seconds.

Example#

add_filter( 'rpress_live_orders_lookahead', 'my_live_orders_lookahead', 10, 1 );
function my_live_orders_lookahead( $lookahead ) {
	return 6 * HOUR_IN_SECONDS;
}

Notes#

Fired from two places with the same signature: RP_Live_Orders::get_orders() and RPRESS_Order_Alerts::is_service_too_far(). The value is cast to int in both.

Source#

Applied in:

  • includes/admin/payments/class-live-orders.php (line 216), in RP_Live_Orders::get_orders()
  • includes/features/order-alerts/loader.php (line 353), in RPRESS_Order_Alerts::is_service_too_far()

See also#

Was this page helpful?