Skip to content
Docs
Get RestroPress

Action

rpress_order_print_status_updated

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#

ParameterTypeDescription
$order_idintOrder ID.
$statusstringNew status: printed, failed or not_attempted.
$messagestringDetail message.
$sourcestringSource 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), in rpress_set_order_print_status()
Was this page helpful?