Support

Account

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/