function ClaroHooks::preprocessFileManagedFile

Same name and namespace in other branches
  1. 11.x core/themes/claro/src/Hook/ClaroHooks.php \Drupal\claro\Hook\ClaroHooks::preprocessFileManagedFile()

Implements hook_preprocess_HOOK() for file_managed_file.

Attributes

#[Hook('preprocess_file_managed_file')]

File

core/themes/claro/src/Hook/ClaroHooks.php, line 1079

Class

ClaroHooks
Hook implementations for claro.

Namespace

Drupal\claro\Hook

Code

public function preprocessFileManagedFile(&$variables) : void {
  // Produce the same renderable element structure as image widget has.
  $child_keys = Element::children($variables['element']);
  foreach ($child_keys as $child_key) {
    $variables['data'][$child_key] = $variables['element'][$child_key];
  }
  _claro_preprocess_file_and_image_widget($variables);
}

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