woocommerce_trash_order
Fires immediately after an order is trashed.
Использование
add_action( 'woocommerce_trash_order', 'wp_kama_woocommerce_trash_order_action' ); /** * Function for `woocommerce_trash_order` action-hook. * * @param int $order_id ID of the order that has been trashed. * * @return void */ function wp_kama_woocommerce_trash_order_action( $order_id ){ // action... }
- $order_id(int)
- ID of the order that has been trashed.
Список изменений
С версии 2.7.0 | Введена. |
Где вызывается хук
woocommerce_trash_order
woocommerce_trash_order
woocommerce/src/Internal/DataStores/Orders/OrdersTableDataStore.php 2263
do_action( 'woocommerce_trash_order', $order_id ); // phpcs:ignore WooCommerce.Commenting.CommentHooks.MissingHookComment
woocommerce/includes/data-stores/abstract-wc-order-data-store-cpt.php 332
do_action( 'woocommerce_trash_order', $id );
Где используется хук в WooCommerce
woocommerce/includes/wc-order-functions.php 1021
add_action( 'woocommerce_trash_order', 'wc_update_coupon_usage_counts' );
woocommerce/includes/wc-order-functions.php 945
add_action( 'woocommerce_trash_order', 'wc_update_total_sales_counts' );