You are here

function farm_fields_field_default_field_instances_alter in farmOS 7

Implements hook_field_default_field_instances_alter().

File

modules/farm/farm_fields/farm_fields.module, line 38

Code

function farm_fields_field_default_field_instances_alter(&$fields) {

  // Set the acceptable file extensions on all file and image field instances.
  foreach ($fields as &$field) {
    if ($field['field_name'] == 'field_farm_images') {
      $field['settings']['file_extensions'] = farm_fields_file_types('image');
    }
    elseif ($field['field_name'] == 'field_farm_files') {
      $field['settings']['file_extensions'] = farm_fields_file_types('file');
    }
  }
}