WordPress at a glance
function is not described

Automattic\WooCommerce\Admin\API\Reports\Orders\Stats

DataStore::delete_order() public WC 1.0

Deletes the order stats when an order is deleted.

{} It's a method of the class: DataStore{}

Return

null. Nothing.

Usage

$result = DataStore::delete_order( $post_id );
$post_id(int) (required)
Post ID.

Code of DataStore::delete_order() WC 5.2.2

<?php
public static function delete_order( $post_id ) {
	global $wpdb;
	$order_id = (int) $post_id;

	if ( 'shop_order' !== get_post_type( $order_id ) && 'shop_order_refund' !== get_post_type( $order_id ) ) {
		return;
	}

	// Retrieve customer details before the order is deleted.
	$order       = wc_get_order( $order_id );
	$customer_id = absint( CustomersDataStore::get_existing_customer_id_from_order( $order ) );

	// Delete the order.
	$wpdb->delete( self::get_db_table_name(), array( 'order_id' => $order_id ) );
	/**
	 * Fires when orders stats are deleted.
	 *
	 * @param int $order_id Order ID.
	 * @param int $customer_id Customer ID.
	 */
	do_action( 'woocommerce_analytics_delete_order_stats', $order_id, $customer_id );

	ReportsCache::invalidate();
}