Support

Account

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;
    		
    	}
    }