drupal_get_path_alias
includes/bootstrap.inc, line 374
- Versions
- 4.6 – 5
drupal_get_path_alias($path)- 6
drupal_get_path_alias($path, $path_language = '')- 7
drupal_get_path_alias($path = NULL, $path_language = '')
Given an internal Drupal path, return the alias set by the administrator.
Code
<?php
function drupal_get_path_alias($path) {
if (($map = drupal_get_path_map()) && ($newpath = array_search($path, $map))) {
return $newpath;
}
elseif (function_exists('conf_url_rewrite')) {
return conf_url_rewrite($path, 'outgoing');
}
else {
// No alias found. Return the normal path.
return $path;
}
}
?> 