You are here

function hook_xmlsitemap_sitemap_delete in XML sitemap 2.x

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

Respond to XML sitemap deletion.

This hook is invoked from xmlsitemap_sitemap_delete_multiple() after the XML sitemap has been removed from the table in the database.

Parameters

\Drupal\xmlsitemap\XmlSitemapInterface $sitemap: The XML sitemap object that was deleted.

1 invocation of hook_xmlsitemap_sitemap_delete()
xmlsitemap_sitemap_delete_multiple in ./xmlsitemap.module
Delete multiple XML sitemaps.

File

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

Code

function hook_xmlsitemap_sitemap_delete(\Drupal\xmlsitemap\XmlSitemapInterface $sitemap) {
  \Drupal::database()
    ->query("DELETE FROM {mytable} WHERE smid = '%s'", $sitemap->smid);
}