You are here

function claro_preprocess_image_widget in Drupal 9

Same name and namespace in other branches
  1. 8 core/themes/claro/claro.theme \claro_preprocess_image_widget()

Implements hook_preprocess_HOOK() for image_widget.

File

core/themes/claro/claro.theme, line 1230
Functions to support theming in the Claro theme.

Code

function claro_preprocess_image_widget(&$variables) {

  // 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($variables['data']['preview']['#access']) && $variables['data']['preview']['#access'] === FALSE) {
    unset($variables['data']['preview']);
  }
  _claro_preprocess_file_and_image_widget($variables);
}