Last active
August 29, 2015 14:14
-
-
Save bogomolov-dev/99072e08d483a8969139 to your computer and use it in GitHub Desktop.
"Generator" Angabe im Meta-Tag entfernen - Drupal 8
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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