Skip to content
Docs
Get RestroPress

Filter

rpress_service_date_options

Updated
On this page

Filters the date choices in the order popup's date dropdown.

Applied by rpress_get_service_date_options(). When the store hours engine is on and pre-ordering is enabled for the service, the list has every date with a slot; the popup's current date is always included when given. Changing the list changes only what is offered in the dropdown, so also adjust slot availability if a date must not be bookable.

Available since RestroPress 3.5.1.

Parameters#

ParameterTypeDescription
$optionsarrayY-m-d date => display label.
$service_typestringService type.
$current_datestringDate the popup opened on, Y-m-d.

Return value#

array. Date => label.

Example#

add_filter( 'rpress_service_date_options', 'my_service_date_options', 10, 3 );
function my_service_date_options( $options, $service_type, $current_date ) {
	$today = rpress_get_wp_now()->format( 'Y-m-d' );
	if ( isset( $options[ $today ] ) ) {
		$options[ $today ] = __( 'Today', 'my-plugin' );
	}
	return $options;
}

Source#

Applied in:

  • includes/features/slot-engine/functions.php (line 228), in rpress_get_service_date_options()

See also#

Was this page helpful?