Home › Forums › General Issues › Checking post status › Reply To: Checking post status
When adding a new post, or when updating an existing post, the post_updated
hook fires before ACF saves any of the current values in the fields to the database.
On a new post you are not getting the values because they do not exist yet.
On an existing post, while you are getting the values you are more than likely getting the old values and not getting the correct value for anything that has been changed.
In order to ensure that you’re getting the latest values you need to rework you action/filter to use the acf/save_post hook detailed here https://www.advancedcustomfields.com/resources/acf-save_post/ and use a priority of > 10.
You can continue using your filter, but instead of using get_field() to get any values you will need to use the $_POST[] values being submitted, there is information on using these on the acf/save_post page.
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.