Home › Forums › Front-end Issues › acf/save_post hook how to display error message › Reply To: acf/save_post hook how to display error message
For the first issue, you cannot report errors on the acf/save_post hook. In order to do error checking before the new values are inserted you need to create acf/validate_value filters for your fields. https://www.advancedcustomfields.com/resources/acf-validate_value/ and test the values to ensure an error will not happen before you attempt to insert the user.
For the second problem, inserting the values into options. The reason for this is that the post ID value is, when ACF saves the post it does not know what “create_user” means and assumes it is options. You should not be using an acf/save_post filter in case. What you should be using is an acf/pre_save_post filter https://www.advancedcustomfields.com/resources/acf-pre_save_post/
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.