You are here

function hook_xmlsitemap_rebuild_clear in XML sitemap 2.x

Same name and namespace in other branches
  1. 8 xmlsitemap.api.php \hook_xmlsitemap_rebuild_clear()
  2. 7.2 xmlsitemap.api.php \hook_xmlsitemap_rebuild_clear()

Respond to XML sitemap link clearing and rebuilding.

Parameters

array $entity_type_ids: An array of entity type IDs that are being rebuilt.

bool $save_custom: If links with overridden status and/or priority are being removed or not.

1 invocation of hook_xmlsitemap_rebuild_clear()
XmlSitemapGenerator::rebuildBatchClear in src/XmlSitemapGenerator.php
Batch callback; clear sitemap links for entites.

File

./xmlsitemap.api.php, line 114
Hooks provided by the XML sitemap module.

Code

function hook_xmlsitemap_rebuild_clear(array $entity_type_ids, $save_custom) {
  \Drupal::database()
    ->delete('mytable')
    ->condition('link_type', $entity_type_ids, 'IN')
    ->execute();
}