Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

how to get the values of other fields in acf validate values

add_filter('acf/validate_value/key=field_56e069e986d6f', 'my_validate_function', 10, 4);

function my_validate_function($valid, $value, $field, $input) {
  $other_field_key = 'field_56e06fe24d3e7';
  $other_value = $_POST['acf'][$other_field_key];
  // now you can do validation based on the other value
  return $valid
}
 
PREVIOUS NEXT
Tagged: #values #fields #acf #validate #values
ADD COMMENT
Topic
Name
9+1 =