You are here

public function XMLSitemapWriter::getSitemapUrl in XML sitemap 7.2

Same name and namespace in other branches
  1. 6.2 xmlsitemap.xmlsitemap.inc \XMLSitemapWriter::getSitemapUrl()

Get Sitemap URL.

2 calls to XMLSitemapWriter::getSitemapUrl()
XMLSitemapIndexWriter::generateXML in ./xmlsitemap.xmlsitemap.inc
Generate XML.
XMLSitemapWriter::writeXSL in ./xmlsitemap.xmlsitemap.inc
Add the XML stylesheet to the XML page.

File

./xmlsitemap.xmlsitemap.inc, line 98
XML sitemap integration functions for xmlsitemap.module.

Class

XMLSitemapWriter
Extended class for writing XML sitemap files.

Code

public function getSitemapUrl($path, array $options = array()) {
  global $base_url;
  $options += $this->sitemap->uri['options'];
  $options += array(
    'absolute' => TRUE,
    'base_url' => variable_get('xmlsitemap_base_url', $base_url),
    'language' => language_default(),
    'alias' => TRUE,
  );
  if (!empty($options['protocol_relative'])) {
    $options['base_url'] = preg_replace('~^https?:~', '', $options['base_url']);
  }
  return url($path, $options);
}