woocommerce_product_published
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
woocommerce_product_published
woocommerce/includes/class-wc-post-data.php 158
do_action( 'woocommerce_product_published', $post->ID );