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
simple_sitemap
Commits
d082775d
Commit
d082775d
authored
Sep 04, 2016
by
Pawel G
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Alter API documentation to reflect API changes
parent
076bac0f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
2 deletions
+13
-2
simple_sitemap.api.php
simple_sitemap.api.php
+13
-2
No files found.
simple_sitemap.api.php
View file @
d082775d
...
...
@@ -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'
]);
}
}
}
}
...
...
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