Skip to content
Docs
Get RestroPress

Filter

rpress_mobile_ordering_store_state

Updated
On this page

Filters the store card state shown above the menu.

The state describes one service. Keys are 'service', 'open', 'status', 'next_open', 'can_schedule' and 'chips'. The chips are short facts such as preparation time, delivery fee and minimum order.

Available since RestroPress 3.5.

Parameters#

ParameterTypeDescription
$statearrayCard state.
$servicestringService slug.

Return value#

array. Card state.

Example#

add_filter( 'rpress_mobile_ordering_store_state', 'my_store_state', 10, 2 );
function my_store_state( $state, $service ) {
	if ( 'delivery' === $service ) {
		$state['chips'][] = __( 'Contactless delivery', 'my-plugin' );
	}
	return $state;
}

Source#

Applied in:

  • includes/features/mobile-ordering/functions.php (line 222), in rpress_mobile_ordering_store_state()
Was this page helpful?