Skip to content

Instantly share code, notes, and snippets.

@bogomolov-dev
Last active August 29, 2015 14:14
Show Gist options
  • Save bogomolov-dev/99072e08d483a8969139 to your computer and use it in GitHub Desktop.
Save bogomolov-dev/99072e08d483a8969139 to your computer and use it in GitHub Desktop.
"Generator" Angabe im Meta-Tag entfernen - Drupal 8
<?php
function my_theme_preprocess_page(array &$variables)
{
/** @var \Drupal\Core\Page\HtmlPage $page */
$page = $variables['page']['#page'];
$metaElements = $page->getMetaElements();
foreach ($metaElements as $index => $metaElement)
{
if ($metaElement->getName() === 'Generator')
{
unset($page->getMetaElements()[$index]);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment