From ee2140944c8938cdd57205571ec841ce7eea78ee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Demarle?= Date: Thu, 29 Mar 2018 14:52:19 +0200 Subject: [PATCH] add action woocommerce_before_delete_{$post_type} --- includes/data-stores/class-wc-product-data-store-cpt.php | 1 + 1 file changed, 1 insertion(+) diff --git a/includes/data-stores/class-wc-product-data-store-cpt.php b/includes/data-stores/class-wc-product-data-store-cpt.php index 5f94ae8af41..66201945a1e 100644 --- a/includes/data-stores/class-wc-product-data-store-cpt.php +++ b/includes/data-stores/class-wc-product-data-store-cpt.php @@ -258,6 +258,7 @@ class WC_Product_Data_Store_CPT extends WC_Data_Store_WP implements WC_Object_Da } if ( $args['force_delete'] ) { + do_action( 'woocommerce_before_delete_' . $post_type, $id ); wp_delete_post( $id ); $product->set_id( 0 ); do_action( 'woocommerce_delete_' . $post_type, $id );