I think you have miss-understood my advice with this one.
Looking at your code, I can see that your function ‘custom_post_title’ is not actually doing anything, yest you are still using the ‘wp_insert_post_data’ action to do your logic.
What I have tried to explain is that you SHOULDNT use the wp_insert_post_data action, but instead use the update_value filter instead.
An action or a filter is a point in time where you can run some custom functionality. As stated previously, the wp_insert_post_data action is TOO EARLY to work correctly. You need to use the acf filter instead to get the latest ACF values and then use a wp_update_post function to modify the $post object.
I hope you understand this.
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.