Commit d082775d authored by gbyte.co's avatar gbyte.co

Alter API documentation to reflect API changes

parent 076bac0f
......@@ -18,9 +18,20 @@
* Array containing multilingual links generated for each path to be indexed.
*/
function hook_simple_sitemap_links_alter(&$links) {
// Remove German links for all paths in the hreflang sitemap.
// Remove German URL for a certain path in the hreflang sitemap.
foreach($links as &$link) {
unset($link['urls']['de']);
if ($link['path'] == 'node/1') {
// Remove 'loc' URL if it points to a german site.
if ($link['langcode'] == 'de') {
unset($link);
}
// If this 'loc' URL points to a non-german site, make sure to remove
// its german alternate URL.
else {
unset($link['alternate_urls']['de']);
}
}
}
}
......
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