Filter
rpress_service_time_label
On this page
Filters the text a customer sees for an order time slot.
Only the label changes; the option value saved with the order stays the plain slot time. It is used by the delivery, pickup and date-time popup templates and by the time options list, for example to show a time range instead of one time.
Available since RestroPress 3.5.1.
Parameters#
| Parameter | Type | Description |
|---|---|---|
$time | string | Slot as listed, in the store time format. |
$service_type | string | Service type. |
$service_date | string | Date in Y-m-d, or '' when unknown. |
Return value#
string. Label to display.
Example#
add_filter( 'rpress_service_time_label', 'my_time_window_label', 10, 3 );
function my_time_window_label( $time, $service_type, $service_date ) {
if ( 'delivery' !== $service_type ) {
return $time;
}
return sprintf( __( 'From %s', 'my-plugin' ), $time );
}
Notes#
Not applied to the ASAP choice in the list built by rpress_get_service_time_options().
Source#
Applied in:
includes/features/slot-engine/functions.php(line 245), inrpress_service_time_label()
See also#
Was this page helpful?
