Skip to content
Docs
Get RestroPress

Filter

rpress_reservation_last_seating_offset

Updated
On this page

Filters how long before closing the last reservation slot may start.

Used in rpress_reservation_get_slots() to work out the latest slot start as closing time minus this offset. The default is one slot interval, so the last slot starts one interval before closing. Return a number of seconds; a larger value ends bookings earlier, for example to leave time for a full meal.

Parameters#

ParameterTypeDescription
$stepintDefault offset in seconds, equal to the slot interval.
$datestringDate being calculated (Y-m-d).

Return value#

int. Offset in seconds subtracted from the closing time.

Example#

function my_reservation_last_seating( $offset, $date ) {
	return 90 * MINUTE_IN_SECONDS;
}
add_filter( 'rpress_reservation_last_seating_offset', 'my_reservation_last_seating', 10, 2 );

Notes#

The result is cast to int.

Source#

Applied in:

  • includes/features/reservations/functions.php (line 244), in rpress_reservation_get_slots()

See also#

Was this page helpful?