You are here

function _xmlsitemap_get_path_alias in XML sitemap 5.2

Same name and namespace in other branches
  1. 5 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

1 call to _xmlsitemap_get_path_alias()
xmlsitemap_url in xmlsitemap/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/xmlsitemap.module, line 542
Creates a sitemap 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() == i18n_default_language()) {
    i18n_get_lang_prefix($result, TRUE);
  }
  return $result;
}