function media_library_form_alter
Same name in other branches
- 9 core/modules/media_library/media_library.module \media_library_form_alter()
- 10 core/modules/media_library/media_library.module \media_library_form_alter()
Implements hook_form_alter().
File
-
core/
modules/ media_library/ media_library.module, line 295
Code
function media_library_form_alter(array &$form, FormStateInterface $form_state, $form_id) {
// Add a process callback to ensure that the media library view's exposed
// filters submit button is not moved to the modal dialog's button area.
if ($form_id === 'views_exposed_form' && strpos($form['#id'], 'views-exposed-form-media-library-widget') === 0) {
$form['#after_build'][] = '_media_library_views_form_media_library_after_build';
}
// Configures media_library displays when a type is submitted.
if ($form_state->getFormObject() instanceof MediaTypeForm) {
$form['actions']['submit']['#submit'][] = '_media_library_media_type_form_submit';
}
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.