You are here

function theme_fivestar_select in Fivestar 8

Same name and namespace in other branches
  1. 5 fivestar.module \theme_fivestar_select()
  2. 6.2 fivestar.module \theme_fivestar_select()
  3. 6 fivestar.module \theme_fivestar_select()
  4. 7.2 includes/fivestar.theme.inc \theme_fivestar_select()

Themes the straight HTML version of the fivestar select list. This is used to remove the wrapping 'form-item' div from the select list.

1 string reference to 'theme_fivestar_select'
fivestar_theme in ./fivestar.module
Implements hook_theme().

File

includes/fivestar.theme.inc, line 158
Provides the theming functions for fivestar.

Code

function theme_fivestar_select($variables) {
  $element = $variables['element'];
  unset($element['#theme']);
  return \Drupal::service('renderer')
    ->render($element);
  Element::setAttributes($element, [
    'id',
    'name',
    'size',
  ]);
  RenderElement::setAttributes($element, [
    'form-select',
  ]);
  $variables['#attributes'] = $element['#attributes'];
  $variables['#options'] = form_select_options($element);
  $variables['#theme'] = 'select';
}