function umami_preprocess_image_widget
Same name in other branches
- 9 core/profiles/demo_umami/themes/umami/umami.theme \umami_preprocess_image_widget()
- 10 core/profiles/demo_umami/themes/umami/umami.theme \umami_preprocess_image_widget()
Implements hook_preprocess_image_widget().
@todo Revisit in https://drupal.org/node/3117430
File
-
core/
profiles/ demo_umami/ themes/ umami/ umami.theme, line 168
Code
function umami_preprocess_image_widget(&$variables) {
if (!empty($variables['element']['fids']['#value'])) {
$file = reset($variables['element']['#files']);
$variables['data']["file_{$file->id()}"]['filename']['#suffix'] = ' <span class="file-size">(' . ByteSizeMarkup::create($file->getSize()) . ')</span> ';
}
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.