function hook_media_source_info_alter

Same name in other branches
  1. 9 core/modules/media/media.api.php \hook_media_source_info_alter()
  2. 8.9.x core/modules/media/media.api.php \hook_media_source_info_alter()
  3. 10 core/modules/media/media.api.php \hook_media_source_info_alter()

Alters the information provided in \Drupal\media\Annotation\MediaSource.

Parameters

array $sources: The array of media source plugin definitions, keyed by plugin ID.

Related topics

2 functions implement hook_media_source_info_alter()

Note: this list is generated by pattern matching, so it may include some functions that are not actually implementations of this hook.

media_library_form_overwrite_test_media_source_info_alter in core/modules/media_library/tests/modules/media_library_form_overwrite_test/media_library_form_overwrite_test.module
media_library_media_source_info_alter in core/modules/media_library/media_library.module
Implements hook_media_source_info_alter().
1 invocation of hook_media_source_info_alter()
MediaSourceManager::__construct in core/modules/media/src/MediaSourceManager.php
Constructs a new MediaSourceManager.

File

core/modules/media/media.api.php, line 19

Code

function hook_media_source_info_alter(array &$sources) {
    $sources['youtube']['label'] = t('Youtube rocks!');
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.