woocommerce_untrash_order
Fires before an order is restored from the trash.
Usage
add_action( 'woocommerce_untrash_order', 'wp_kama_woocommerce_untrash_order_action', 10, 2 ); /** * Function for `woocommerce_untrash_order` action-hook. * * @param int $order_id Order ID. * @param string $previous_status The status of the order before it was trashed. * * @return void */ function wp_kama_woocommerce_untrash_order_action( $order_id, $previous_status ){ // action... }
- $order_id(int)
- Order ID.
- $previous_status(string)
- The status of the order before it was trashed.
Changelog
Since 7.2.0 | Introduced. |
Where the hook is called
woocommerce_untrash_order
woocommerce/src/Internal/DataStores/Orders/OrdersTableDataStore.php 2463
do_action( 'woocommerce_untrash_order', $order->get_id(), $previous_status );
Where the hook is used in WooCommerce
woocommerce/includes/wc-order-functions.php 946
add_action( 'woocommerce_untrash_order', 'wc_update_total_sales_counts' );