Commit cfbe8c9e authored by Dave Reid's avatar Dave Reid

Issue #2416983 by Dave Reid: Added hook_xmlsitemap_rebuild_clear().

parent cd45c8be
......@@ -113,6 +113,20 @@ function hook_xmlsitemap_link_update(array $link, array $context) {
->execute();
}
/**
* Respond to XML sitemap link clearing and rebuilding.
*
* @param array $types
* An array of link types that are being rebuilt.
* @param bool $save_custom
* If links with overridden status and/or priority are being removed or not.
*/
function hook_xmlsitemap_rebuild_clear(array $types, $save_custom) {
db_delete('mytable')
->condition('link_type', $types, 'IN')
->execute();
}
/**
* Index links for the XML sitemaps.
*/
......
......@@ -424,6 +424,9 @@ function xmlsitemap_batch_variable_set(array $variables) {
*/
function xmlsitemap_rebuild_batch_clear(array $entities, $save_custom, &$context) {
if (!empty($entities)) {
// Let other modules respond to the rebuild clearing.
module_invoke_all('xmlsitemap_rebuild_clear', $entities, $save_custom);
$query = db_delete('xmlsitemap');
$query->condition('type', $entities);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment