wordpress - Woocommerce Product publish, update and delete hooks -


i need woocommerce product publish, update , delete hooks if 1 know please inform me.

i find hook :

add_action('transition_post_status', 'wpse_110037_new_posts', 10, 3);  function wpse_110037_new_posts($new_status, $old_status, $post) {  if(          $old_status != 'publish'          && $new_status == 'publish'          && !empty($post->id)          && in_array( $post->post_type,              array( 'product')              )         ) {           //add cde here      }    } 

but it's display product id, title, publish status etc....but want product price, category, tag, brand , stock status.

so please replay me if 1 know.

thanks, ketan.

woocommerce products wordpress posts. can use wordpress hooks

add_action( 'before_delete_post', 'wpse_110037_new_posts' ); add_action( 'save_post', 'wpse_110037_new_posts' );  function wpse_110037_new_posts($post_id){     $wc_product = wc_get_product( $post_id); } 

wc_get_product() return wc_product object , can product details it.


Comments