You are here

function media_library_media_source_info_alter in Drupal 9

Same name and namespace in other branches
  1. 8 core/modules/media_library/media_library.module \media_library_media_source_info_alter()

Implements hook_media_source_info_alter().

File

core/modules/media_library/media_library.module, line 84
Contains hook implementations for the media_library module.

Code

function media_library_media_source_info_alter(array &$sources) {
  if (empty($sources['audio_file']['forms']['media_library_add'])) {
    $sources['audio_file']['forms']['media_library_add'] = FileUploadForm::class;
  }
  if (empty($sources['file']['forms']['media_library_add'])) {
    $sources['file']['forms']['media_library_add'] = FileUploadForm::class;
  }
  if (empty($sources['image']['forms']['media_library_add'])) {
    $sources['image']['forms']['media_library_add'] = FileUploadForm::class;
  }
  if (empty($sources['video_file']['forms']['media_library_add'])) {
    $sources['video_file']['forms']['media_library_add'] = FileUploadForm::class;
  }
  if (empty($sources['oembed:video']['forms']['media_library_add'])) {
    $sources['oembed:video']['forms']['media_library_add'] = OEmbedForm::class;
  }
}