Filter
rpress_service_time_options
On this page
Filters the list of time choices for a service on a date.
Applied by rpress_get_service_time_options(), whose list is returned over AJAX for the order popup. Each entry has value (what is saved) and label (what is shown). For today, an ASAP choice comes first when that option is enabled, and it is the only choice when "ASAP only" is on. Removing an entry hides it from this list but does not by itself block that time elsewhere.
Available since RestroPress 3.5.1.
Parameters#
| Parameter | Type | Description |
|---|---|---|
$options | array[] | List of array( 'value' => string, 'label' => string ). |
$service_type | string | Sanitized service type. |
$service_date | string | Requested date. |
Return value#
array[]. List of value and label pairs.
Example#
add_filter( 'rpress_service_time_options', 'my_service_time_options', 10, 3 );
function my_service_time_options( $options, $service_type, $service_date ) {
if ( 'pickup' === $service_type && $options ) {
$options[0]['label'] .= ' ' . __( '(earliest)', 'my-plugin' );
}
return $options;
}
Notes#
The popup and checkout templates also build their own time lists, which this filter does not change.
Source#
Applied in:
includes/features/slot-engine/functions.php(line 282), inrpress_get_service_time_options()
See also#
Was this page helpful?
