woocommerce_before_delete_(post_type)
Использование
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
- -
Где вызывается хук
woocommerce/includes/data-stores/class-wc-product-data-store-cpt.php 422
do_action( 'woocommerce_before_delete_' . $post_type, $id );
Где используется хук в WooCommerce
woocommerce/includes/class-wc-post-data.php 66
add_action( 'woocommerce_before_delete_order', array( __CLASS__, 'before_delete_order' ) );
woocommerce/includes/wc-order-functions.php 1000
add_action( 'woocommerce_before_delete_order', 'wc_update_total_sales_counts' );
woocommerce/src/Admin/API/Reports/Orders/Stats/DataStore.php 144
add_action( 'woocommerce_before_delete_order', array( __CLASS__, 'delete_order' ) );
woocommerce/src/Admin/Features/Fulfillments/FulfillmentsManager.php 106
add_action( 'woocommerce_before_delete_order', array( $this, 'delete_order_fulfillments' ), 10, 1 );
woocommerce/src/Caches/OrderCountCacheService.php 51
add_action( 'woocommerce_before_delete_order', array( $this, 'update_on_order_deleted' ), 10, 2 );
woocommerce/src/Internal/Caches/OrdersVersionStringInvalidator.php 66
add_action( 'woocommerce_before_delete_order', array( $this, 'handle_woocommerce_before_delete_order' ), 10, 2 );
woocommerce/src/Internal/Caches/ProductVersionStringInvalidator.php 69
add_action( 'woocommerce_before_delete_product', array( $this, 'handle_woocommerce_before_delete_product' ), 10, 1 );
woocommerce/src/Internal/Caches/ProductVersionStringInvalidator.php 75
add_action( 'woocommerce_before_delete_product_variation', array( $this, 'handle_woocommerce_before_delete_product_variation' ), 10, 1 );
woocommerce/src/Internal/OrderReviews/Scheduler.php 65
add_action( 'woocommerce_before_delete_order', array( $this, 'handle_cancellation' ), 10, 1 );