Action
rpress_live_orders_controls
On this page
Fires in the Live Orders bar after the Pause and Busy mode controls.
Use it to print extra controls next to "Pause new orders" and "Add to prep time". The panel is re-rendered over AJAX after pause or busy changes, so bind JavaScript events by delegation on the document rather than directly to your elements.
Available since RestroPress 3.5.1.
Parameters#
| Parameter | Type | Description |
|---|---|---|
$state | array | Current pause and busy state: paused (bool), until, extra_prep (minutes) and extra_until. Times are Unix timestamps, 0 when unset. |
Example#
add_action( 'rpress_live_orders_controls', 'my_live_orders_control', 10, 1 );
function my_live_orders_control( $state ) {
if ( ! empty( $state['paused'] ) ) {
return;
}
echo '<button type="button" class="button my-print-queue-button">' . esc_html__( 'Print queue', 'my-plugin' ) . '</button>';
}
Source#
Fired from:
includes/features/pause-orders/views/admin-panel.php(line 102)
Was this page helpful?
