Home › Forums › Backend Issues (wp-admin) › Validate a group of fields in admin page › Reply To: Validate a group of fields in admin page
For future readers:
Please use the filter as documented here: http://www.advancedcustomfields.com/resources/filters/acfvalidate_value/
You can apply if to 1 of the 10 fields and within the function, look at the $_POST[‘acf’] array. You will need to find the field key’s for each of the fields and then loop over them to check if one of them contains a value.
If nothing is found, simply return false or a custom validation message.
Hope that helps
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!
🚨 The 2023 ACF Annual Survey closes tomorrow! This is your last chance to complete the survey and help guide the evolution of ACF. https://t.co/0cgr9ZFOJ5— Advanced Custom Fields (@wp_acf) May 18, 2023
© 2023 Advanced Custom Fields.