woocommerce_untrash_order хук-событиеWC 7.2.0

Fires before an order is restored from the trash.

Использование

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(строка)
The status of the order before it was trashed.

Список изменений

С версии 7.2.0 Введена.

Где вызывается хук

OrdersTableDataStore::untrash_order()
woocommerce_untrash_order
woocommerce/src/Internal/DataStores/Orders/OrdersTableDataStore.php 2344
do_action( 'woocommerce_untrash_order', $order->get_id(), $previous_status );

Где используется хук в WooCommerce

woocommerce/includes/wc-order-functions.php 923
add_action( 'woocommerce_untrash_order', 'wc_update_total_sales_counts' );