Why is the ACF/SAVE_POST action called 3 times when you update a post?
I’m having issues with processing form data in my code, so I put a simple error_log(‘acf/save_post’); at the beginning of my function to make sure it was being called.
Not only was it being called, but it was called 3 times every time I click the “Update” button in WordPress to update the post.
I tried using get_current_screen() to see under what context it’s called, but the first time it’s called, WordPress isn’t fully set up yet and the get_current_screen() function doesn’t exist.
Hmm, I spun up a blank site and acf/save_post is only called once.
So, how do I track down the other culprits?
debug_backtrace() was my friend… Figured it out.