5 * Hooks provided by the Simple XML sitemap module.
14 * Alter the generated link data before the sitemap is saved.
15 * This hook gets invoked for every sitemap chunk generated.
17 * @param array &$links
18 * Array containing multilingual links generated for each path to be indexed.
20 function hook_simple_sitemap_links_alter(&$links) {
22 // Remove German URL for a certain path in the hreflang sitemap.
23 foreach ($links as &$link) {
24 if ($link['path'] == 'node/1') {
25 // Remove 'loc' URL if it points to a german site.
26 if ($link['langcode'] == 'de') {
29 // If this 'loc' URL points to a non-german site, make sure to remove
30 // its german alternate URL.
32 unset($link['alternate_urls']['de']);
39 * @} End of "addtogroup hooks".