Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x

starterkit_theme.theme

Functions to support theming.

File

core/themes/starterkit_theme/starterkit_theme.theme

View source
<?php


/**
 * @file
 * Functions to support theming.
 */

/**
 * Implements hook_preprocess_image_widget().
 */
function starterkit_theme_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']);
    }
}

Functions

Title Deprecated Summary
starterkit_theme_preprocess_image_widget Implements hook_preprocess_image_widget().

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal