Home › Forums › General Issues › Using acf/validate_value to validate repeater field › Reply To: Using acf/validate_value to validate repeater field
Hi @jpcote
You can make use of the acf/validate_value filter to validate the value of the sub_fields within the repeater by hooking in to the filter using the $field_type.
You can try something like this:
add_filter('acf/validate_value/type={$field_type}', 'my_acf_validate_value', 10, 4);
function my_acf_validate_value( $valid, $value, $field, $input ){
// bail early if value is already invalid
if( !$valid ) {
return $valid;
}
}
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 use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.