Aha! The answer lies here: http://codex.wordpress.org/Plugin_API/Action_Reference/save_post#Avoiding_infinite_loops
Essentially I was creating an infinite loop of updating the value <–> updating the post. Not sure why this suddenly started happening (where it was working fine before), perhaps a WP or ACF change means that the update_value filter is getting triggered by wp_update_post where it wasn’t before.
Anyway, simple solution is:
remove_filter('acf/update_value/name=author', 'author_acf_update_value', 10); wp_update_post(array('ID' => $post_id,'post_author' => $value)); add_filter('acf/update_value/name=author', 'author_acf_update_value', 10, 3);
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!
© 2022 Advanced Custom Fields.