Filter
rpress_reservation_slots
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#
| Parameter | Type | Description |
|---|---|---|
$slots | array | List of slots, each with ts, time, label, remaining and available. |
$date | string | Date (Y-m-d). |
$party | int | Party 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), inrpress_reservation_get_slots()
See also#
Was this page helpful?
