Skip to content
Docs
Get RestroPress

Filter

rpress_should_validate_time_slot

Updated
On this page

Filters whether the selected time slot is validated against the current time when an order is validated.

Runs in the pre-order validation. When true and the selected time is not hidden or ASAP and is empty or already past, the next available slot is selected automatically and stored in the service time cookies; if none is available the validation returns a 'no longer available' error. The default is true only when the Order Time Intervals Limit add-on is detected.

Parameters#

ParameterTypeDescription
$should_validateboolTrue when the order time interval limit add-on is active.
$service_typestringService slug.
$service_datestringService date.
$service_time_rawstringThe selected service time as submitted.

Return value#

bool. Whether to validate the time slot.

Example#

function my_validate_time_slot( $should_validate, $service_type, $service_date, $service_time_raw ) {
	return true;
}
add_filter( 'rpress_should_validate_time_slot', 'my_validate_time_slot', 10, 4 );

Source#

Applied in:

  • includes/rp-core-functions.php (line 1625), in rpress_pre_validate_order()

See also#

Was this page helpful?