Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /* Make sure product.create and product.update webhooks work when product created or edited from frontend dashboard */
- add_action( 'after_wcfm_products_manage_meta_save', function($new_product_id, $wcfm_products_manage_form_data) {
- $product = wc_get_product($new_product_id);
- if(isset($wcfm_products_manage_form_data['pro_id']) && $wcfm_products_manage_form_data['pro_id'] == 0) {
- do_action( 'woocommerce_new_product', $new_product_id, $product );
- } else {
- do_action( 'woocommerce_update_product', $new_product_id, $product );
- }
- }, 10, 2 );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement