drupal_get_path_alias

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
path_nodeapi in modules/path.module
Implementation of hook_nodeapi().
url in includes/common.inc
Generate an internal Drupal URL.

Code

includes/bootstrap.inc, line 374

<?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;
  }
}
?>
Login or register to post comments
 
 

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.