Home › Forums › ACF PRO › Check post type before publishing post › Reply To: Check post type before publishing post
If you are using ACF fields values to generate your value then you need to us the acf/save_post action instead of wp_insert_post_data. ACF does not save fields until after your filter runs so you are seeing the old values of any fields and not any changes. https://www.advancedcustomfields.com/resources/acf-save_post/
If you want to use the hook you’re using then you need to look in $_POST[‘acf’] to get the new values. This is covered on the above page as well.
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.