So the way I ended up implementing this was using the
acf_add_validation_error('acf[field_4a5c3fe1d1]', 'some error description');. Notice that you have to use
acf[field_id] in this, you cannot use a post value UNLESS it is an additional field in the front end form. This took a day of debugging and I would love it if the documentation was updated for this use case. For those of you trying this and slamming your head against the wall, just make sure to use
acf_add_validation_error, and use the field ID if it is part of the post’s custom fields. Good luck!
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 demoed ACF 6.1 Beta during the most recent session of ACF Chat Fridays, highlighting the new ability to regenerate and clear labels, setting the Admin Menu Parent as a slug, and more. Catch the video replay in our latest summary. https://t.co/rHEpPVas64 pic.twitter.com/hB1XKTexXi— Advanced Custom Fields (@wp_acf) March 23, 2023
© 2023 Advanced Custom Fields.