function claro_preprocess_image_widget in Drupal 8
Same name and namespace in other branches
- 9 core/themes/claro/claro.theme \claro_preprocess_image_widget()
Implements hook_preprocess_HOOK() for image_widget.
File
- core/
themes/ claro/ claro.theme, line 1179 - Functions to support theming in the Claro theme.
Code
function claro_preprocess_image_widget(&$variables) {
// Stable adds the file size as #suffix for image file_link renderable array.
// We have to remove that because we will render it in our file_link template
// for every kind of files, and not just for images.
if (!empty($variables['element']['fids']['#value'])) {
$file = reset($variables['element']['#files']);
unset($variables['data']['file_' . $file
->id()]['filename']['#suffix']);
}
_claro_preprocess_file_and_image_widget($variables);
}