function classy_preprocess_image_widget in Drupal 9
Same name and namespace in other branches
- 8 core/themes/classy/classy.theme \classy_preprocess_image_widget()
Implements hook_preprocess_image_widget().
File
- core/themes/ classy/ classy.theme, line 43 
- Functions to support theming in the Classy theme.
Code
function classy_preprocess_image_widget(array &$variables) {
  $data =& $variables['data'];
  // This prevents image widget templates from rendering preview container HTML
  // to users that do not have permission to access these previews.
  // @todo revisit in https://drupal.org/node/953034
  // @todo revisit in https://drupal.org/node/3114318
  if (isset($data['preview']['#access']) && $data['preview']['#access'] === FALSE) {
    unset($data['preview']);
  }
}