diff --git a/plugins/woocommerce-admin/includes/data-stores/class-wc-admin-reports-coupons-data-store.php b/plugins/woocommerce-admin/includes/data-stores/class-wc-admin-reports-coupons-data-store.php index f41a4a3547c..e73eabbf121 100644 --- a/plugins/woocommerce-admin/includes/data-stores/class-wc-admin-reports-coupons-data-store.php +++ b/plugins/woocommerce-admin/includes/data-stores/class-wc-admin-reports-coupons-data-store.php @@ -345,6 +345,12 @@ class WC_Admin_Reports_Coupons_Data_Store extends WC_Admin_Reports_Data_Store im ) ); + /** + * Fires when coupon's reports are updated. + * + * @param int $coupon_id Coupon ID. + * @param int $order_id Order ID. + */ do_action( 'woocommerce_update_reports_coupon', $coupon_id, $order_id ); } } diff --git a/plugins/woocommerce-admin/includes/data-stores/class-wc-admin-reports-customers-data-store.php b/plugins/woocommerce-admin/includes/data-stores/class-wc-admin-reports-customers-data-store.php index 25a1ae26a44..d3995ec37c9 100644 --- a/plugins/woocommerce-admin/includes/data-stores/class-wc-admin-reports-customers-data-store.php +++ b/plugins/woocommerce-admin/includes/data-stores/class-wc-admin-reports-customers-data-store.php @@ -436,6 +436,11 @@ class WC_Admin_Reports_Customers_Data_Store extends WC_Admin_Reports_Data_Store ); $customer_id = $wpdb->insert_id; + /** + * Fires when customser's reports are created. + * + * @param int $customer_id Customer ID. + */ do_action( 'woocommerce_new_reports_customer', $customer_id ); return $result ? $customer_id : false; @@ -562,6 +567,11 @@ class WC_Admin_Reports_Customers_Data_Store extends WC_Admin_Reports_Data_Store $results = $wpdb->replace( $wpdb->prefix . self::TABLE_NAME, $data, $format ); + /** + * Fires when customser's reports are updated. + * + * @param int $customer_id Customer ID. + */ do_action( 'woocommerce_update_reports_customer', $customer_id ); return $results; } diff --git a/plugins/woocommerce-admin/includes/data-stores/class-wc-admin-reports-orders-stats-data-store.php b/plugins/woocommerce-admin/includes/data-stores/class-wc-admin-reports-orders-stats-data-store.php index 5a4bac5113e..e7754a0fc33 100644 --- a/plugins/woocommerce-admin/includes/data-stores/class-wc-admin-reports-orders-stats-data-store.php +++ b/plugins/woocommerce-admin/includes/data-stores/class-wc-admin-reports-orders-stats-data-store.php @@ -447,6 +447,11 @@ class WC_Admin_Reports_Orders_Stats_Data_Store extends WC_Admin_Reports_Data_Sto // Update or add the information to the DB. $results = $wpdb->replace( $table_name, $data, $format ); + /** + * Fires when order's stats reports are updated. + * + * @param int $order_id Order ID. + */ do_action( 'woocommerce_update_reports_order_stats', $order->get_id() ); return $results; } diff --git a/plugins/woocommerce-admin/includes/data-stores/class-wc-admin-reports-products-data-store.php b/plugins/woocommerce-admin/includes/data-stores/class-wc-admin-reports-products-data-store.php index bece834f866..b85b86aa76c 100644 --- a/plugins/woocommerce-admin/includes/data-stores/class-wc-admin-reports-products-data-store.php +++ b/plugins/woocommerce-admin/includes/data-stores/class-wc-admin-reports-products-data-store.php @@ -343,6 +343,13 @@ class WC_Admin_Reports_Products_Data_Store extends WC_Admin_Reports_Data_Store i array( 'order_item_id' => $order_item_id ), array( '%d' ) ); + + /** + * Fires when product's reports are deleted. + * + * @param int $order_item_id Order Item ID. + * @param int $order_id Order ID. + */ do_action( 'woocommerce_delete_reports_product', $order_item_id, $order->get_id() ); } else { $wpdb->replace( @@ -369,6 +376,12 @@ class WC_Admin_Reports_Products_Data_Store extends WC_Admin_Reports_Data_Store i ) ); + /** + * Fires when product's reports are updated. + * + * @param int $order_item_id Order Item ID. + * @param int $order_id Order ID. + */ do_action( 'woocommerce_update_reports_product', $order_item_id, $order->get_id() ); } } diff --git a/plugins/woocommerce-admin/includes/data-stores/class-wc-admin-reports-taxes-data-store.php b/plugins/woocommerce-admin/includes/data-stores/class-wc-admin-reports-taxes-data-store.php index ac9278e8405..3764508a86b 100644 --- a/plugins/woocommerce-admin/includes/data-stores/class-wc-admin-reports-taxes-data-store.php +++ b/plugins/woocommerce-admin/includes/data-stores/class-wc-admin-reports-taxes-data-store.php @@ -285,6 +285,12 @@ class WC_Admin_Reports_Taxes_Data_Store extends WC_Admin_Reports_Data_Store impl ) ); + /** + * Fires when tax's reports are updated. + * + * @param int $tax_rate_id Tax Rate ID. + * @param int $order_id Order ID. + */ do_action( 'woocommerce_update_reports_tax', $tax_item->get_rate_id(), $order->get_id() ); } }