Start with default generated template
This commit is contained in:
21
aaron.theme
Normal file
21
aaron.theme
Normal file
@@ -0,0 +1,21 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* @file
|
||||
* Functions to support theming.
|
||||
*/
|
||||
|
||||
/**
|
||||
* Implements hook_preprocess_image_widget().
|
||||
*/
|
||||
function aaron_preprocess_image_widget(array &$variables): void {
|
||||
$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']);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user