function template_preprocess_sitemap_item in Sitemap 8.2
Same name and namespace in other branches
- 2.0.x sitemap.theme.inc \template_preprocess_sitemap_item()
Implements hook_preprocess_HOOK().
File
- ./
sitemap.theme.inc, line 13 - Sitemap theme preprocessors.
Code
function template_preprocess_sitemap_item(&$variables) {
$variables['plugin_type'] = '';
$variables['plugin_id'] = '';
if (isset($variables['sitemap'])) {
if ($id = $variables['sitemap']
->getPluginDefinition()['id']) {
$filter = [
' ' => '-',
'_' => '-',
'/' => '-',
'[' => '-',
']' => '-',
':' => '-',
];
$variables['plugin_type'] = Html::cleanCssIdentifier($id, $filter);
$variables['plugin_id'] = Html::cleanCssIdentifier($variables['sitemap']
->getPluginId(), $filter);
}
}
}