function template_preprocess_twitter_widget in Twitter Profile Widget 8
Prepares variables for Twitter widget templates.
Default template: twitter_widget.html.twig.
Parameters
array $variables: An associative array containing:
- elements: An associative array containing the user information and any
- attributes: HTML attributes for the containing element.
File
- ./
twitter_widget.page.inc, line 22 - Contains twitter_widget.page.inc.
Code
function template_preprocess_twitter_widget(array &$variables) {
// Fetch TwitterWidget Entity Object.
$twitter_widget = $variables['elements']['#twitter_widget'];
// Helpful $content variable for templates.
foreach (Element::children($variables['elements']) as $key) {
$variables['content'][$key] = $variables['elements'][$key];
}
}