function PreprocessHooks::fieldsetMediaLibraryWidget
Same name and namespace in other branches
- 11.x core/themes/admin/src/Hook/PreprocessHooks.php \Drupal\admin\Hook\PreprocessHooks::fieldsetMediaLibraryWidget()
Implements hook_preprocess_fieldset__media_library_widget().
@todo Remove this when https://www.drupal.org/project/drupal/issues/2999549 lands.
Attributes
#[Hook('preprocess_fieldset__media_library_widget')]
See also
\Drupal\media_library\Plugin\Field\FieldWidget\MediaLibraryWidget::formElement()
File
-
core/
themes/ admin/ src/ Hook/ PreprocessHooks.php, line 444
Class
- PreprocessHooks
- Provides preprocess implementations.
Namespace
Drupal\admin\HookCode
public function fieldsetMediaLibraryWidget(array &$variables) : void {
if (isset($variables['prefix']['weight_toggle'])) {
$variables['prefix']['weight_toggle']['#attributes']['class'][] = 'action-link';
$variables['prefix']['weight_toggle']['#attributes']['class'][] = 'action-link--extrasmall';
$variables['prefix']['weight_toggle']['#attributes']['class'][] = 'action-link--icon-show';
$variables['prefix']['weight_toggle']['#attributes']['class'][] = 'media-library-widget__toggle-weight';
}
if (isset($variables['suffix']['open_button'])) {
$variables['suffix']['open_button']['#attributes']['class'][] = 'media-library-open-button';
}
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.