simple_sitemap_views.module 624 Bytes
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
<?php

/**
 * @file
 * Contains simple_sitemap_views.module.
 */

/**
 * Implements hook_cron().
 */
function simple_sitemap_views_cron() {
  // Create tasks in the garbage collection queue.
  \Drupal::service('simple_sitemap.views')->executeGarbageCollection();
}

/**
 * Implements hook_simple_sitemap_sitemap_types_alter().
 */
function simple_sitemap_views_simple_sitemap_sitemap_types_alter(array &$sitemap_types) {
  // Add a 'views' UrlGenerator plugin to the default hreflang sitemap type.
  if (isset($sitemap_types['default_hreflang'])) {
    $sitemap_types['default_hreflang']['urlGenerators'][] = 'views';
  }
}