woocommerce_trash_(post_type)
Usage
add_action( 'woocommerce_trash_(post_type)', 'wp_kama_woocommerce_trash_post_type_action' );
/**
* Function for `woocommerce_trash_(post_type)` action-hook.
*
* @param $id
*
* @return void
*/
function wp_kama_woocommerce_trash_post_type_action( $id ){
// action...
}
- $id
- -
Where the hook is called
woocommerce/includes/data-stores/class-wc-product-data-store-cpt.php 429
do_action( 'woocommerce_trash_' . $post_type, $id );
Where the hook is used in WooCommerce
woocommerce/includes/wc-order-functions.php 1074
add_action( 'woocommerce_trash_order', 'wc_update_coupon_usage_counts' );
woocommerce/includes/wc-order-functions.php 998
add_action( 'woocommerce_trash_order', 'wc_update_total_sales_counts' );
woocommerce/src/Internal/Caches/OrdersVersionStringInvalidator.php 67
add_action( 'woocommerce_trash_order', array( $this, 'handle_woocommerce_trash_order' ), 10, 1 );
woocommerce/src/Internal/Caches/ProductVersionStringInvalidator.php 70
add_action( 'woocommerce_trash_product', array( $this, 'handle_woocommerce_trash_product' ), 10, 1 );
woocommerce/src/Internal/Caches/ProductVersionStringInvalidator.php 76
add_action( 'woocommerce_trash_product_variation', array( $this, 'handle_woocommerce_trash_product_variation' ), 10, 1 );