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

Action for the transition.

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

add_action( 'woocommerce_product_type_changed', 'wp_kama_woocommerce_product_type_changed_action', 10, 3 );

/**
 * Function for `woocommerce_product_type_changed` action-hook.
 * 
 * @param  $product  
 * @param  $old_type 
 * @param  $new_type 
 *
 * @return void
 */
function wp_kama_woocommerce_product_type_changed_action( $product, $old_type, $new_type ){

	// action...
}
$product
-
$old_type
-
$new_type
-

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

WC_Product_Data_Store_CPT::update_version_and_type()
woocommerce_product_type_changed
woocommerce/includes/data-stores/class-wc-product-data-store-cpt.php 863
do_action( 'woocommerce_product_type_changed', $product, $old_type, $new_type );

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

woocommerce/includes/class-wc-post-data.php 41
add_action( 'woocommerce_product_type_changed', array( __CLASS__, 'product_type_changed' ), 10, 3 );