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.

▾ 3 functions call drupal_get_path_alias()

block_list in modules/block.module
Return all blocks in the specied region for the current user. You may use this function to implement variable block regions. The default regions are 'left', 'right' and 'all', where 'all' means both left...
path_nodeapi in modules/path.module
Implementation of hook_nodeapi().
url in includes/common.inc
Generate an internal Drupal URL.

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;
  }
}
?>
 
 

All source code and documentation on this site is released under the terms of the GNU General Public License, version 2 and later. Drupal is a registered trademark of Dries Buytaert.