woocommerce_product_type_changed

The WooCommerce woocommerce product type changed hook.

Description

do_action( 'woocommerce_product_type_changed', (unknown) $product, (unknown) $old_type, (unknown) $new_type ); 

Parameters (3)

0. $product (unknown)
The product.
1. $old_type (unknown)
The old type.
2. $new_type (unknown)
The new type.

Usage

To run the hook, copy the example below.
  1. // run the action 
  2. do_action( 'woocommerce_product_type_changed', $product, $old_type, $new_type ); 
The following example is for adding a hook callback.
  1. // define the woocommerce_product_type_changed callback 
  2. function action_woocommerce_product_type_changed( $product, $old_type, $new_type ) { 
  3. // make action magic happen here... 
  4. }; 
  5.  
  6. // add the action 
  7. add_action( 'woocommerce_product_type_changed', 'action_woocommerce_product_type_changed', 10, 3 ); 
To remove a hook callback, use the example below.
  1. // remove the action 
  2. remove_action( 'woocommerce_product_type_changed', 'action_woocommerce_product_type_changed', 10, 3 ); 

Defined (1)

The action is defined in the following location(s).

/includes/data-stores/class-wc-product-data-store-cpt.php  
  1. do_action( 'woocommerce_product_type_changed', $product, $old_type, $new_type );