woocommerce_order_status_(from)_to_(to) хук-событиеWC 1.0

Note the transition occurred.

Использование

add_action( 'woocommerce_order_status_(from)_to_(to)', 'wp_kama_woocommerce_order_status_from_to_action', 10, 2 );

/**
 * Function for `woocommerce_order_status_(from)_to_(to)` action-hook.
 * 
 * @param  $id   
 * @param  $that 
 *
 * @return void
 */
function wp_kama_woocommerce_order_status_from_to_action( $id, $that ){

	// action...
}
$id
-
$that
-

Где вызывается хук

WC_Order::status_transition()
woocommerce_order_status_(from)_to_(to)
woocommerce/includes/class-wc-order.php 373
do_action( 'woocommerce_order_status_' . $status_transition['from'] . '_to_' . $status_transition['to'], $this->get_id(), $this );

Где используется хук в WooCommerce

woocommerce/includes/emails/class-wc-email-cancelled-order.php 42
add_action( 'woocommerce_order_status_processing_to_cancelled_notification', array( $this, 'trigger' ), 10, 2 );
woocommerce/includes/emails/class-wc-email-cancelled-order.php 43
add_action( 'woocommerce_order_status_on-hold_to_cancelled_notification', array( $this, 'trigger' ), 10, 2 );
woocommerce/includes/emails/class-wc-email-customer-on-hold-order.php 42
add_action( 'woocommerce_order_status_pending_to_on-hold_notification', array( $this, 'trigger' ), 10, 2 );
woocommerce/includes/emails/class-wc-email-customer-on-hold-order.php 43
add_action( 'woocommerce_order_status_failed_to_on-hold_notification', array( $this, 'trigger' ), 10, 2 );
woocommerce/includes/emails/class-wc-email-customer-on-hold-order.php 44
add_action( 'woocommerce_order_status_cancelled_to_on-hold_notification', array( $this, 'trigger' ), 10, 2 );
woocommerce/includes/emails/class-wc-email-customer-processing-order.php 43
add_action( 'woocommerce_order_status_cancelled_to_processing_notification', array( $this, 'trigger' ), 10, 2 );
woocommerce/includes/emails/class-wc-email-customer-processing-order.php 44
add_action( 'woocommerce_order_status_failed_to_processing_notification', array( $this, 'trigger' ), 10, 2 );
woocommerce/includes/emails/class-wc-email-customer-processing-order.php 45
add_action( 'woocommerce_order_status_on-hold_to_processing_notification', array( $this, 'trigger' ), 10, 2 );
woocommerce/includes/emails/class-wc-email-customer-processing-order.php 46
add_action( 'woocommerce_order_status_pending_to_processing_notification', array( $this, 'trigger' ), 10, 2 );
woocommerce/includes/emails/class-wc-email-failed-order.php 42
add_action( 'woocommerce_order_status_on-hold_to_failed_notification', array( $this, 'trigger' ), 10, 2 );
woocommerce/includes/emails/class-wc-email-failed-order.php 41
add_action( 'woocommerce_order_status_pending_to_failed_notification', array( $this, 'trigger' ), 10, 2 );
woocommerce/includes/emails/class-wc-email-new-order.php 41
add_action( 'woocommerce_order_status_pending_to_processing_notification', array( $this, 'trigger' ), 10, 2 );
woocommerce/includes/emails/class-wc-email-new-order.php 42
add_action( 'woocommerce_order_status_pending_to_completed_notification', array( $this, 'trigger' ), 10, 2 );
woocommerce/includes/emails/class-wc-email-new-order.php 43
add_action( 'woocommerce_order_status_pending_to_on-hold_notification', array( $this, 'trigger' ), 10, 2 );
woocommerce/includes/emails/class-wc-email-new-order.php 44
add_action( 'woocommerce_order_status_failed_to_processing_notification', array( $this, 'trigger' ), 10, 2 );
woocommerce/includes/emails/class-wc-email-new-order.php 45
add_action( 'woocommerce_order_status_failed_to_completed_notification', array( $this, 'trigger' ), 10, 2 );
woocommerce/includes/emails/class-wc-email-new-order.php 46
add_action( 'woocommerce_order_status_failed_to_on-hold_notification', array( $this, 'trigger' ), 10, 2 );
woocommerce/includes/emails/class-wc-email-new-order.php 47
add_action( 'woocommerce_order_status_cancelled_to_processing_notification', array( $this, 'trigger' ), 10, 2 );
woocommerce/includes/emails/class-wc-email-new-order.php 48
add_action( 'woocommerce_order_status_cancelled_to_completed_notification', array( $this, 'trigger' ), 10, 2 );
woocommerce/includes/emails/class-wc-email-new-order.php 49
add_action( 'woocommerce_order_status_cancelled_to_on-hold_notification', array( $this, 'trigger' ), 10, 2 );