Action
rpress_order_print_status_updated
On this page
Fires after an order's print status is recorded.
Runs in rpress_set_order_print_status() after the status meta is saved or cleared. Accepted statuses are printed, failed and not_attempted, and unknown orders or statuses return before the action fires. The status is passed through sanitize_key() before the action fires; the message and source are passed as given.
Available since RestroPress 3.5.
Parameters#
| Parameter | Type | Description |
|---|---|---|
$order_id | int | Order ID. |
$status | string | New status: printed, failed or not_attempted. |
$message | string | Detail message. |
$source | string | Source label, such as board, pos or cloud. |
Example#
add_action( 'rpress_order_print_status_updated', 'my_print_status_updated', 10, 4 );
function my_print_status_updated( $order_id, $status, $message, $source ) {
if ( 'failed' === $status ) {
error_log( sprintf( 'Print failed for order %d: %s', $order_id, $message ) );
}
}
Source#
Fired from:
includes/features/order-alerts/functions.php(line 91), inrpress_set_order_print_status()
Was this page helpful?
