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

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

add_action( 'woocommerce_new_product', 'wp_kama_woocommerce_new_product_action', 10, 2 );

/**
 * Function for `woocommerce_new_product` action-hook.
 * 
 * @param  $id      
 * @param  $product 
 *
 * @return void
 */
function wp_kama_woocommerce_new_product_action( $id, $product ){
	// action...
}
$id
-
$product
-

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

WC_Product_Data_Store_CPT::create()
woocommerce_new_product
woocommerce/includes/data-stores/class-wc-product-data-store-cpt.php 263
do_action( 'woocommerce_new_product', $id, $product );

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

woocommerce/includes/class-wc-brands.php 53
add_action( 'woocommerce_new_product', array( $this, 'duplicate_add_product_brand_terms' ) );
woocommerce/includes/class-wc-brands.php 54
add_action( 'woocommerce_new_product', array( $this, 'invalidate_wc_layered_nav_counts_cache' ), 10, 0 );
woocommerce/src/Admin/Features/OnboardingTasks/Tasks/Products.php 38
add_action( 'woocommerce_new_product', array( $this, 'maybe_set_has_product_transient' ), 10, 2 );
woocommerce/src/Admin/ReportsSync.php 28
add_action( 'woocommerce_new_product', array( __CLASS__, 'clear_stock_count_cache' ) );
woocommerce/src/Internal/Caches/ProductVersionStringInvalidator.php 67
add_action( 'woocommerce_new_product', array( $this, 'handle_woocommerce_new_product' ), 10, 1 );