You are here

function xmlsitemap_sitemap_delete_multiple in XML sitemap 7.2

Same name and namespace in other branches
  1. 8 xmlsitemap.module \xmlsitemap_sitemap_delete_multiple()
  2. 6.2 xmlsitemap.module \xmlsitemap_sitemap_delete_multiple()
  3. 2.x xmlsitemap.module \xmlsitemap_sitemap_delete_multiple()

Delete multiple XML sitemaps.

Parameters

array $smids: An array of XML sitemap IDs.

Related topics

1 call to xmlsitemap_sitemap_delete_multiple()
xmlsitemap_sitemap_delete in ./xmlsitemap.module
Delete an XML sitemap.

File

./xmlsitemap.module, line 502
xmlsitemap XML sitemap

Code

function xmlsitemap_sitemap_delete_multiple(array $smids) {
  if (!empty($smids)) {
    $sitemaps = xmlsitemap_sitemap_load_multiple($smids);
    db_delete('xmlsitemap_sitemap')
      ->condition('smid', $smids)
      ->execute();
    foreach ($sitemaps as $sitemap) {
      xmlsitemap_clear_directory($sitemap, TRUE);
      module_invoke_all('xmlsitemap_sitemap_delete', $sitemap);
    }
  }
}