Filter
rpress_service_hours_rollover_date
On this page
Filters the date that takes over from today after midnight.
Used by RPRESS_Service_Hours::get_rollover_date() when today has no slots left but tomorrow does. The value is tomorrow's date (Y-m-d) when ordering carries on past midnight, or null when today still applies. It is not applied when the function returns early because today still has slots or tomorrow has none.
Parameters#
| Parameter | Type | Description |
|---|---|---|
$value | string|null | Tomorrow's date (Y-m-d), or null. |
$service | string | Service type, or an empty string. |
$now | DateTimeImmutable | Current time in the site timezone. |
Return value#
string|null. Date (Y-m-d) that takes over, or null.
Example#
function my_service_hours_rollover( $date, $service, $now ) {
if ( 'pickup' === $service ) {
return null;
}
return $date;
}
add_filter( 'rpress_service_hours_rollover_date', 'my_service_hours_rollover', 10, 3 );
Notes#
The first argument is an expression.
Source#
Applied in:
includes/features/slot-engine/class-rpress-service-hours.php(line 654), inRPRESS_Service_Hours::get_rollover_date()
See also#
Was this page helpful?
