add action woocommerce_before_delete_{$post_type}

This commit is contained in:
Frédéric Demarle 2018-03-29 14:52:19 +02:00
parent 4a6c526229
commit ee2140944c
1 changed files with 1 additions and 0 deletions

View File

@ -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 );