function _slick_preprocess_slick_item in Slick Carousel 8
Same name and namespace in other branches
- 8.2 templates/slick.theme.inc \_slick_preprocess_slick_item()
Prepares common variables for slick item templates.
3 calls to _slick_preprocess_slick_item()
- template_preprocess_slick_slide in templates/slick.theme.inc 
- Prepares variables for slick-slide.html.twig templates.
- template_preprocess_slick_thumbnail in templates/slick.theme.inc 
- Prepares variables for slick-thumbnail.html.twig templates.
- template_preprocess_slick_vanilla in templates/slick.theme.inc 
- Prepares variables for slick-vanilla.html.twig templates.
File
- templates/slick.theme.inc, line 130 
- Hooks and preprocess functions for the Slick module.
Code
function _slick_preprocess_slick_item(&$variables) {
  foreach ([
    'attributes',
    'delta',
    'item',
    'settings',
  ] as $key) {
    $default = $key == 'delta' ? NULL : [];
    $variables[$key] = isset($variables['element']["#{$key}"]) ? $variables['element']["#{$key}"] : $default;
  }
}