You are here

simple_sitemap_views.module in Simple XML sitemap 8.3

Same filename and directory in other branches
  1. 4.x modules/simple_sitemap_views/simple_sitemap_views.module

File

modules/simple_sitemap_views/simple_sitemap_views.module
View source
<?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';
  }
}