Advertisement
palsushobhan

wcfm-integrate-woocommerce-product-add-edit-webhooks

Apr 19th, 2025
133
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.57 KB | None | 0 0
  1. /* Make sure product.create and product.update webhooks work when product created or edited from frontend dashboard */
  2. add_action( 'after_wcfm_products_manage_meta_save', function($new_product_id, $wcfm_products_manage_form_data) {
  3.     $product = wc_get_product($new_product_id);
  4.     if(isset($wcfm_products_manage_form_data['pro_id']) && $wcfm_products_manage_form_data['pro_id'] == 0) {
  5.         do_action( 'woocommerce_new_product', $new_product_id, $product );
  6.     } else {
  7.         do_action( 'woocommerce_update_product', $new_product_id, $product );
  8.     }
  9. }, 10, 2 );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement