woocommerce_order_status_changed хук-событиеWC 1.0

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

add_action( 'woocommerce_order_status_changed', 'wp_kama_woocommerce_order_status_changed_action', 10, 4 );

/**
 * Function for `woocommerce_order_status_changed` action-hook.
 * 
 * @param  $id                     
 * @param  $status_transition_from 
 * @param  $status_transition_to   
 * @param  $that                   
 *
 * @return void
 */
function wp_kama_woocommerce_order_status_changed_action( $id, $status_transition_from, $status_transition_to, $that ){

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

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

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

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

woocommerce/includes/tracks/events/class-wc-orders-tracking.php 20
add_action( 'woocommerce_order_status_changed', array( $this, 'track_order_status_change' ), 10, 3 );