You are here

function xmlsitemap_get_operation_link in XML sitemap 2.x

Same name and namespace in other branches
  1. 8 xmlsitemap.module \xmlsitemap_get_operation_link()
  2. 6.2 xmlsitemap.module \xmlsitemap_get_operation_link()
  3. 7.2 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 1499
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;
}