Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Open sidebar
project
xmlsitemap
Commits
cfbe8c9e
Commit
cfbe8c9e
authored
Jan 29, 2015
by
Dave Reid
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Issue
#2416983
by Dave Reid: Added hook_xmlsitemap_rebuild_clear().
parent
cd45c8be
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
0 deletions
+17
-0
xmlsitemap.api.php
xmlsitemap.api.php
+14
-0
xmlsitemap.generate.inc
xmlsitemap.generate.inc
+3
-0
No files found.
xmlsitemap.api.php
View file @
cfbe8c9e
...
...
@@ -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.
*/
...
...
xmlsitemap.generate.inc
View file @
cfbe8c9e
...
...
@@ -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
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment