You are here

function xmlsitemap_xmlsitemap_link_alter in XML sitemap 2.x

Same name and namespace in other branches
  1. 8 xmlsitemap.module \xmlsitemap_xmlsitemap_link_alter()
  2. 6.2 xmlsitemap.xmlsitemap.inc \xmlsitemap_xmlsitemap_link_alter()
  3. 7.2 xmlsitemap.xmlsitemap.inc \xmlsitemap_xmlsitemap_link_alter()

Implements hook_xmlsitemap_link_alter().

File

./xmlsitemap.module, line 1929
xmlsitemap XML sitemap

Code

function xmlsitemap_xmlsitemap_link_alter(&$link) {

  // Alter the frontpage priority.
  if ($link['type'] == 'frontpage' || $link['loc'] == '/' || $link['loc'] == Drupal::config('system.site')
    ->get('page.front')) {
    $link['priority'] = \Drupal::config('xmlsitemap.settings')
      ->get('frontpage_priority');
    $link['changefreq'] = \Drupal::config('xmlsitemap.settings')
      ->get('frontpage_changefreq');
  }
}