You are here

function xmlsitemap_rebuild_batch_clear in XML sitemap 6.2

Same name and namespace in other branches
  1. 8 xmlsitemap.module \xmlsitemap_rebuild_batch_clear()
  2. 7.2 xmlsitemap.generate.inc \xmlsitemap_rebuild_batch_clear()
  3. 2.x xmlsitemap.module \xmlsitemap_rebuild_batch_clear()

Batch callback; clear sitemap links for entites.

1 string reference to 'xmlsitemap_rebuild_batch_clear'
xmlsitemap_rebuild_batch in ./xmlsitemap.generate.inc
Batch information callback for rebuilding the sitemap data.

File

./xmlsitemap.generate.inc, line 456
Sitemap generation and rebuilding functions for the xmlsitemap module.

Code

function xmlsitemap_rebuild_batch_clear(array $entities, $save_custom, &$context) {
  if (!empty($entities)) {
    $sql = "DELETE FROM {xmlsitemap} WHERE type IN (" . db_placeholders($entities, 'varchar') . ')';

    // If we want to save the custom data, make sure to exclude any links
    // that are not using default inclusion or priority.
    if ($save_custom) {
      $sql .= ' AND status_override = 0 AND priority_override = 0';
    }
    db_query($sql, $entities);
  }
  $context['message'] = t('Purging links.');
}