Skip to content
Docs
Get RestroPress

Filter

rpress_reservation_slots

Updated
On this page

Filters the bookable reservation slots for a date.

Returned by rpress_reservation_get_slots() after slots are generated from store hours, lead time and capacity. Each slot is an array with ts (Unix timestamp), time (H:i), label (formatted time), remaining (seats left) and available (whether the party fits). The same list is used for the form and for validating a submission, so a slot removed here cannot be booked.

Parameters#

ParameterTypeDescription
$slotsarrayList of slots, each with ts, time, label, remaining and available.
$datestringDate (Y-m-d).
$partyintParty size used to flag slots without room.

Return value#

array. The list of slots, with the same structure.

Example#

function my_reservation_slots( $slots, $date, $party ) {
	return array_values(
		array_filter(
			$slots,
			function ( $slot ) {
				return '15:00' !== $slot['time'];
			}
		)
	);
}
add_filter( 'rpress_reservation_slots', 'my_reservation_slots', 10, 3 );

Notes#

Not applied when the date is invalid, outside the booking window, or the store is closed that day.

Source#

Applied in:

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

See also#

Was this page helpful?