function xmlsitemap_get_operation_link in XML sitemap 8
Same name and namespace in other branches
- 6.2 xmlsitemap.module \xmlsitemap_get_operation_link()
- 7.2 xmlsitemap.module \xmlsitemap_get_operation_link()
- 2.x xmlsitemap.module \xmlsitemap_get_operation_link()
Gets a link from url.
@static string $destination Destination option.
Parameters
string $url: Url of the link.
array $options: Extra options of the url such as 'query'.
Return value
array An array representing a link.
File
- ./
xmlsitemap.module, line 1539 - xmlsitemap XML sitemap
Code
function xmlsitemap_get_operation_link($url, array $options = []) {
static $destination;
if (!isset($destination)) {
$destination = \Drupal::destination()
->getAsArray();
}
$link = [
'href' => $url,
] + $options;
$link += [
'query' => $destination,
];
return $link;
}