You are here

function template_preprocess_media_library_item in Drupal 8

Same name and namespace in other branches
  1. 9 core/modules/media_library/media_library.module \template_preprocess_media_library_item()

Prepares variables for a selected media item.

Default template: media-library-item.html.twig.

Parameters

array $variables: An associative array containing:

  • element: An associative array containing the properties and children of the element.

File

core/modules/media_library/media_library.module, line 146
Contains hook implementations for the media_library module.

Code

function template_preprocess_media_library_item(array &$variables) {
  $element =& $variables['element'];
  foreach (Element::children($element) as $key) {
    $variables['content'][$key] = $element[$key];
  }
}