function ClaroHooks::formMediaLibraryAddFormOembedAlter
Implements hook_form_FORM_ID_alter() for media_library_add_form_oembed.
Attributes
#[Hook('form_media_library_add_form_oembed_alter')]
File
-
core/
themes/ claro/ src/ Hook/ ClaroHooks.php, line 1229
Class
- ClaroHooks
- Hook implementations for claro.
Namespace
Drupal\claro\HookCode
public function formMediaLibraryAddFormOembedAlter(array &$form, FormStateInterface $form_state) : void {
$form['#attributes']['class'][] = 'media-library-add-form--oembed';
// If no media items have been added yet, add a couple of styling classes
// to the initial URL form.
if (isset($form['container'])) {
$form['container']['#attributes']['class'][] = 'media-library-add-form__input-wrapper';
$form['container']['url']['#attributes']['class'][] = 'media-library-add-form-oembed-url';
$form['container']['submit']['#attributes']['class'][] = 'media-library-add-form-oembed-submit';
}
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.