Skip to content
Docs
Get RestroPress

Filter

rpress_store_timings

Updated
On this page

Filters the list of available order time slots for a service type and date.

Applied to the slots produced by the store timing generator, both when rendering service hours and when building the normalized slot list. Entries are time strings formatted for display (or unix timestamps when rpress_timing_for_today is false). Remove entries to make a slot unavailable.

Parameters#

ParameterTypeDescription
$store_timesarrayAvailable time slots.
$service_typestringService slug.
$service_datestringService date in Y-m-d format.

Return value#

array. The time slots.

Example#

function my_store_timings( $store_times, $service_type, $service_date ) {
	if ( 'delivery' === $service_type ) {
		return array_slice( $store_times, 0, 20 );
	}
	return $store_times;
}
add_filter( 'rpress_store_timings', 'my_store_timings', 10, 3 );

Notes#

Fired from rp_get_store_service_hours() and rpress_get_available_service_slots() with the same signature.

Source#

Applied in:

  • includes/rp-core-functions.php (line 1039), in rp_get_store_service_hours()
  • includes/rp-core-functions.php (line 1267), in rpress_get_available_service_slots()

See also#

Was this page helpful?