Action
rpress_order_alert_acknowledged
On this page
Fires after a new-order alert is acknowledged for the first time.
Runs from RPRESS_Order_Popup::acknowledge() once the acknowledgement (user and time) has been saved in the _rpress_order_alert_ack order meta. The acknowledgement applies to every user and device. It does not accept the order or change its status.
Available since RestroPress 3.5.1.
Parameters#
| Parameter | Type | Description |
|---|---|---|
$order_id | int | Order (payment) ID. |
$user_id | int | ID of the user who acknowledged it, 0 if none was given. |
Example#
add_action( 'rpress_order_alert_acknowledged', 'my_log_alert_ack', 10, 2 );
function my_log_alert_ack( $order_id, $user_id ) {
$user = get_userdata( $user_id );
$name = $user ? $user->display_name : __( 'unknown user', 'my-plugin' );
rpress_insert_payment_note( $order_id, sprintf( __( 'New-order alert acknowledged by %s.', 'my-plugin' ), $name ) );
}
Notes#
Does not fire again for an order that is already acknowledged.
Source#
Fired from:
includes/features/order-alerts/popup.php(line 133), inRPRESS_Order_Popup::acknowledge()
Was this page helpful?
