<is_type>

The WooCommerce is type hook.

Description

do_action( '<is_type>', (unknown) $product_with_stock ); 

Parameters (1)

0. $product_with_stock (unknown)
The product with stock.

Usage

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

Defined (3)

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

/includes/wc-stock-functions.php  
  1. do_action( $product_with_stock->is_type( 'variation' ) ? 'woocommerce_variation_set_stock' : 'woocommerce_product_set_stock', $product_with_stock ); 
/includes/data-stores/class-wc-product-data-store-cpt.php  
  1. do_action( $product->is_type( 'variation' ) ? 'woocommerce_variation_set_stock' : 'woocommerce_product_set_stock' , $product ); 
  1. do_action( $product->is_type( 'variation' ) ? 'woocommerce_variation_set_stock_status' : 'woocommerce_product_set_stock_status' , $product->get_id(), $product->get_stock_status(), $product );