Home › Forums › General Issues › Update ACF field when WooCommerce order status switched to “Processing” › Reply To: Update ACF field when WooCommerce order status switched to “Processing”
I think that this is an order of operation issue.
The WC woocommerce_order_status_processing fires before the WP save_post hook. ACF updates values on the save_post hook. If you try to update ACF fields on the first hook then ACF runs and updates it again and removes the value you just added.
If the ACF field is available to enter the order_shipping_number when updating the order is there a specific reason that you want to update it with code?
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.