Home › Forums › General Issues › Callback for update succes › Reply To: Callback for update succes
update_field returns true on success and false on failure, but considers a useless update (meaning the value has not changed) failure.
You could call update_field, and then compare the new value in $_POST to the value returned by get_field to see if the update actually took place correctly, and return a message based on that test.
The underlying code is using WordPress’ update_metadata function; you could probably get the last MySQL error (maybe using $wpdb->last_error?) to get a more detailed error message on why an UPDATE statement failed.
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.