woocommerce_before_delete_(post_type)
Usage
add_action( 'woocommerce_before_delete_(post_type)', 'wp_kama_woocommerce_before_delete_post_type_action' ); /** * Function for `woocommerce_before_delete_(post_type)` action-hook. * * @param $id * * @return void */ function wp_kama_woocommerce_before_delete_post_type_action( $id ){ // action... }
- $id
- -
Where the hook is called
woocommerce/includes/data-stores/class-wc-product-data-store-cpt.php 376
do_action( 'woocommerce_before_delete_' . $post_type, $id );
Where the hook is used in WooCommerce
woocommerce/includes/class-wc-post-data.php 57
add_action( 'woocommerce_before_delete_order', array( __CLASS__, 'before_delete_order' ) );
woocommerce/includes/wc-order-functions.php 947
add_action( 'woocommerce_before_delete_order', 'wc_update_total_sales_counts' );
woocommerce/src/Admin/API/Reports/Orders/Stats/DataStore.php 130
add_action( 'woocommerce_before_delete_order', array( __CLASS__, 'delete_order' ) );