You are here

function _xmlsitemap_get_path_alias in XML sitemap 5

Same name and namespace in other branches
  1. 5.2 xmlsitemap/xmlsitemap.module \_xmlsitemap_get_path_alias()

Modified version of drupal_get_path_alias() for xmlsitemap_url().

Parameters

$path: An internal Drupal path:

$alias: The URL alias. Default is NULL.:

Return value

A processed path

Related topics

1 call to _xmlsitemap_get_path_alias()
xmlsitemap_url in ./xmlsitemap.module
Modified version of url(). We don't want to do a separate database query for each url, so we pass the alias as an extra parameter.

File

./xmlsitemap.module, line 768
Creates a site map compatible with the sitemaps.org schema.

Code

function _xmlsitemap_get_path_alias($path, $alias = NULL) {
  $result = $path;
  if (!empty($alias)) {
    $result = $alias;
  }
  if (function_exists('custom_url_rewrite')) {
    $result = custom_url_rewrite('alias', $result, $path);
  }
  if (module_exists('i18n')) {
    i18n_get_lang_prefix($result, TRUE);
  }
  return $result;
}