Skip to content
Docs
Get RestroPress

Filter

rpress_order_alerts_max_age

Updated
On this page

Filters how long after placement an order can still ring or show in the new-order popup.

Older orders are left out of the popup, and their Live Orders cards are no longer treated as new-order alerts. It also sets how far back the popup query looks. Values shorter than one hour are raised to one hour.

Available since RestroPress 3.5.1.

Parameters#

ParameterTypeDescription
$secondsintMaximum age in seconds. Default DAY_IN_SECONDS.

Return value#

int. Maximum age in seconds.

Example#

add_filter( 'rpress_order_alerts_max_age', 'my_alerts_max_age', 10, 1 );
function my_alerts_max_age( $seconds ) {
	return 12 * HOUR_IN_SECONDS;
}

Source#

Applied in:

  • includes/features/order-alerts/popup.php (line 70), in RPRESS_Order_Popup::max_age()

See also#

Was this page helpful?