function UmamiHooks::preprocessLinksMediaLibraryMenu

Same name and namespace in other branches
  1. 11.x core/profiles/demo_umami/themes/umami/src/Hook/UmamiHooks.php \Drupal\umami\Hook\UmamiHooks::preprocessLinksMediaLibraryMenu()

Implements hook_preprocess_HOOK() for links--media-library-menu.

This targets the menu of available media types in the media library's modal dialog.

@todo Do this in the relevant template once https://www.drupal.org/project/drupal/issues/3088856 is resolved.

Attributes

#[Hook('preprocess_links__media_library_menu')]

File

core/profiles/demo_umami/themes/umami/src/Hook/UmamiHooks.php, line 155

Class

UmamiHooks
Hook implementations for umami.

Namespace

Drupal\umami\Hook

Code

public function preprocessLinksMediaLibraryMenu(array &$variables) : void {
  foreach ($variables['links'] as &$link) {
    $link['link']['#options']['attributes']['class'][] = 'media-library-menu__link';
  }
}

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