You are here

function template_preprocess_avatar_preview_radio in Avatar Kit 8

Prepares variables for avatar_preview_radio templates.

Default template: avatar-preview-radio.html.twig.

Parameters

array $variables: An associative array containing:

  • element: An associative array containing the properties of the element. Properties used:

    • (optional) image: an image generated by 'image_style' or 'image' themes. Image is omitted if unavailable.
    • radio: a radio element.

File

./avatars.module, line 178

Code

function template_preprocess_avatar_preview_radio(array &$variables) {
  if (isset($variables['element']['image'])) {

    // Image is missing for '_none'.
    $variables['image'] = $variables['element']['image'];
  }
  $variables['radio'] = $variables['element']['radio'];
}