Limit number of uploaded files
add_filter(‘frm_validate_field_entry’, ‘validate_number_of_files’, 10, 3); function validate_number_of_files($errors, $field, $value){ if ( in_array($field->id, array(25,26,27)) && $field->type == ‘file’ && (isset($_FILES[‘file’.$field->id])) && !empty($_FILES[‘file’.$field->id][‘name’])){ $files = (array)$_FILES[‘file’. $field->id][‘name’]; $count = 0; foreach($files as $n){ if(!empty($n)) $count++; } $existing = $_POST[‘item_meta’][$field->id]; if($existing){ foreach($existing as $e){…Continue reading