You are here

function template_preprocess_fivestar_static_element in Fivestar 8

Implements hook_preprocess_HOOK() for the Fivestar static element.

Displays a static fivestar value with a title and description.

File

./fivestar.module, line 319
A simple n-star voting widget, usable in other forms.

Code

function template_preprocess_fivestar_static_element(array &$variables) {
  $variables['content'] = [
    '#type' => 'item',
    '#title' => $variables['title'],
    '#description' => $variables['description'],
    '#description_display' => 'after',
    '#children' => $variables['star_display'],
  ];
}