Hi there,
I codded a function that validate a custom field (https://www.advancedcustomfields.com/resources/acf-validate_value/). But I want to add a conditional to it as this:
if (get_field('example')=='test'){
// validation codes
}
What should I do for this purpose?
Thanks
If you want to validate one field based on a value entered for another field then you must look in $_POST[‘acf’]
if ($_POST['acf']['field_KEY'] == 'test') {
// do something
}