You are here

function metatag_page_attachments_alter in Metatag 8

Implements hook_page_attachments_alter().

File

./metatag.module, line 203
Contains metatag.module.

Code

function metatag_page_attachments_alter(array &$attachments) {
  $route_match = \Drupal::routeMatch();

  // Can be removed once https://www.drupal.org/node/2282029 is fixed.
  if ($route_match
    ->getRouteName() == 'entity.taxonomy_term.canonical' && ($term = $route_match
    ->getParameter('taxonomy_term')) && $term instanceof TermInterface) {
    _metatag_remove_duplicate_entity_tags($attachments);
  }
}