1.20.x file.module file_display_save($file_type, $view_mode, $display)

Saves a {file_display} array to config.

Related topics

File

modules/file/file.module, line 2220
Defines a "managed_file" Form API field and a "file" field for Field module.

Code

function file_display_save($file_type, $view_mode, $display) {
  $config = config('file_display.' . $file_type);
  $config->set('type', $file_type);
  $config->set($view_mode, $display);
  $config->save();

  file_info_cache_clear();
}