Skip to content
Docs
Get RestroPress

Filter

rpress_service_hours_rollover_date

Updated
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#

ParameterTypeDescription
$valuestring|nullTomorrow's date (Y-m-d), or null.
$servicestringService type, or an empty string.
$nowDateTimeImmutableCurrent 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), in RPRESS_Service_Hours::get_rollover_date()

See also#

Was this page helpful?