You are here

function thunder_media_preprocess_media in Thunder 6.2.x

Same name and namespace in other branches
  1. 6.1.x modules/thunder_media/thunder_media.module \thunder_media_preprocess_media()

Implements hook_preprocess_media().

File

modules/thunder_media/thunder_media.module, line 13
Contains media related functions.

Code

function thunder_media_preprocess_media(&$variables) {

  // Remove contextual links from preview in node form.
  if ($variables['elements']['#view_mode'] === 'paragraph_preview' && isset($variables['title_suffix']['contextual_links'])) {
    unset($variables['title_suffix']['contextual_links']);
    unset($variables['elements']['#contextual_links']);
    $variables['attributes']['class'] = array_diff($variables['attributes']['class'], [
      'contextual-region',
    ]);
  }
}