woocommerce_product_published action-hookWC 10.8.0

Fires when a product or product variation transitions to published status.

Usage

add_action( 'woocommerce_product_published', 'wp_kama_woocommerce_product_published_action' );

/**
 * Function for `woocommerce_product_published` action-hook.
 * 
 * @param int $product_id The product or variation ID.
 *
 * @return void
 */
function wp_kama_woocommerce_product_published_action( $product_id ){

	// action...
}
$product_id(int)
The product or variation ID.

Changelog

Since 10.8.0 Introduced.

Where the hook is called

WC_Post_Data::transition_post_status()
woocommerce_product_published
woocommerce/includes/class-wc-post-data.php 158
do_action( 'woocommerce_product_published', $post->ID );

Where the hook is used in WooCommerce

Usage not found.