woocommerce_analytics_delete_order_stats action-hookWC 4.0.0

Fires when orders stats are deleted.

Usage

add_action( 'woocommerce_analytics_delete_order_stats', 'wp_kama_woocommerce_analytics_delete_order_stats_action', 10, 2 );

/**
 * Function for `woocommerce_analytics_delete_order_stats` action-hook.
 * 
 * @param int $order_id    Order ID.
 * @param int $customer_id Customer ID.
 *
 * @return void
 */
function wp_kama_woocommerce_analytics_delete_order_stats_action( $order_id, $customer_id ){

	// action...
}
$order_id(int)
Order ID.
$customer_id(int)
Customer ID.

Changelog

Since 4.0.0 Introduced.

Where the hook is called

DataStore::delete_order()
woocommerce_analytics_delete_order_stats
woocommerce/src/Admin/API/Reports/Orders/Stats/DataStore.php 622
do_action( 'woocommerce_analytics_delete_order_stats', $order_id, $customer_id );

Where the hook is used in WooCommerce

woocommerce/src/Admin/API/Reports/Coupons/DataStore.php 74
add_action( 'woocommerce_analytics_delete_order_stats', array( __CLASS__, 'sync_on_order_delete' ), 5 );
woocommerce/src/Admin/API/Reports/Customers/DataStore.php 100
add_action( 'woocommerce_analytics_delete_order_stats', array( __CLASS__, 'sync_on_order_delete' ), 15, 2 );
woocommerce/src/Admin/API/Reports/Products/DataStore.php 103
add_action( 'woocommerce_analytics_delete_order_stats', array( __CLASS__, 'sync_on_order_delete' ), 10 );
woocommerce/src/Admin/API/Reports/Taxes/DataStore.php 83
add_action( 'woocommerce_analytics_delete_order_stats', array( __CLASS__, 'sync_on_order_delete' ), 15 );