This code does in fact work. In the question I created an edit that talked about it timing out. That was due to the infinite loop that was created. The following code fixes that problem.
function make_api_call( $post_id ) {
//unhook to avoid infinite loop
remove_action( "save_post_product", "make_api_call" );
//make API call and pass data into update array
$update["ID"] = $post_id;
$update["post_title"] = "this title was reset";
//update the post
wp_update_post( $update );
//re-hook the disabled function
add_action( "save_post_product", "make_api_call" );
}
add_action( "save_post_product", "make_api_call" );
Related Posts:
- How to check if is in cart page? [closed]
- Display single product attribute value on Shop page (Woocommerce)
- Is it possible to add custom fields to a WooCommerce attribute term? [closed]
- Woocommerce 3.1 Add product image to order confirmation email not working
- Woocommerce My Account Endpoint – how to get ID parameter from URL?
- How to add Woocomrce cart page shipping calculator to my country state list
- Change add to cart text if a product is in cart on WooCommerce
- Get user payment details when payment successfully done in woocommerce [closed]
- How to assign specific attribute to variation for woocommerce product?
- How to change page via login as user and admin
- How to remove the sub-category from Woocommerce product URL
- Find woocommerce product ID by custom field value?
- how to use different page design for different category
- Getting WordPress database error Deadlock
- Add sub subpage endpoint in woocommerce
- Edit WooCommerce product content based on category
- Place Order button in Checkout
- woocommerce – How Can I add author metadata for a product? [closed]
- shortcode to display woocommerce cart total
- Woocommerce – Want to move the product tabs below short description
- Where is the CSS class ui-sortable-handle for WC_Admin_Taxonomies added?
- WooCommerce: “account is already registered with your email address”
- Enter name and email on the Product page and keep the input data on the Checkout page
- Separeting product from post in search result
- Woocommerce: Same gross price for different tax rates [closed]
- add shoppy.gg to woocommerce instead of add to card [closed]
- Woo commerce using add_fee to add discount to cart not saving discount amount the admin backend when guest user is shopping
- How to change Attribute Type
- WooCommerce plugin won’t let me access settings
- How to edit T&C checker text in Woocommerce checkout page? gettext?
- What is the reason for two classes storefront_woocommerce and storefront
- What’s the fastest way to import products with variations in WooCommerce (CSV, XML, …) [closed]
- Confirm Password on checkout page not working in woocommerce 3.0.1
- Woocommerce’s add_to_cart function returns false and doesn’t add anything to the cart [closed]
- WOOCOOMERCE: Run function before payment gateway (paying)
- How to check woocommerce single product tag
- Can’t filter out variable products in sale from wp_get_products loop (or shortcode) [closed]
- Send email notifications to a defined email address depending if a product in order has a specific TAG [closed]
- Adding author option to [products] woocommerce shortcode
- main menu hide woo commerce single products tittle
- What Hook/Action is performed when a field in checkout form is changed in WooCommerce
- Benefits over using object method over property from $product?
- Colour of selected radio button seems backwards in Twenty Seventeen + Woocommerce
- Add to cart – button should be disabled
- WooCommerce – change child category URL structure
- Hide Add to Cart button on woocommerce Product description page of a particular product
- Customizing WooCommerce
- manage_shop_order_posts_custom_column() hook is Not working In Functions.php file in my WordPress active theme
- How to send woocommerce emails in multiple languages
- Custom WooCommerce rewrite rules with comma delimiter
- Set city as required if country is Singapore
- Woocommerce custom taxonomy filtering
- Woocommerce product tab is not showing probably
- WooCommerce Simple Auctions add username to auction finished email
- Enable Gutenberg for Woocommerce
- How to change product category permalinks programmatically?
- Make e-Mail optional on Woocommerce sign up
- Sharing data between filters on a snippet (user specific) for Woocommerce
- How to add custom checkboxes from loop to WooCommerce product variation options?
- Missing variable options on add to cart form
- Create order actions from custom fields woocommerce
- WooCommerce , Auto cancel orders status from processing after X days
- Change WooCommerce Word “Product” to Another Word
- How does a WooCommerce site integrate with the existing real world customer members?
- How can I send information when a order is completed to my own POS?
- Woocommerce doesn’t work with theme, header missing and css messed up
- Woocommerce Product Variation – Add Price Logic
- How to filter result set in custom metaboxes?
- How to change lost password email text using custom plugin wordpress?
- wc_mail in foreach loop is sending only the first email
- How to fix: “The resource you are looking for has been removed, had its name changed, or is temporarily unavailable.” after malware cleaning
- Can’t update WooCommerce payment method title
- Set Post Thumbnail to external URL
- How to hide / remove duplicated Woocommerce products from Shop page
- How to add product variations for large number of products in WooCommerce?
- WooCommerce related products load random posts per page
- Woocommerce Languages Files
- How to adjust Related Page Thumb Sizes on single page?
- Adding more than one item to Woocommerce cart
- Changing second user role while updating/downgrading membership level – s2member [closed]
- Woocommerce – get product in category with specific attribute
- How to edit the header banner in the search page in woocommerce?
- How can I display one product using WooCommerce
- How do I change the woocommerce product gallery to show all thumbnails instead of three at a time in a carousel?
- How to add a menu page for options in wordpress for user that has the role of vendor?
- Testimonials/Reviews for Products
- How to edit schema.org markup of WooCommerce?
- Turkish Character Problem on mailing
- WooCommerce: Order Details Table > Add Product Meta
- Override function
- How to change redirect code? [duplicate]
- How to disable schema from Wocommerce? [closed]
- Updating order meta to have a meta entry from an item in the order
- Woocommerce – display all sold out products
- Woocommerce how to show most selling products by category
- AffiliateWP not calculating multiple quantities when using affwp_calc_referral_amount filter
- Hide a shipping method if cart total is higher than an amount
- WordPress pointing animated GIF images with wrong file name upon upload (GIFs animation not working)
- How to update all products with same SKU prefixes when updating stock with CSV?
- What is the best and cheapest way to generate dashboards about conversions data and store users? [closed]