drupal_get_path_alias

Definition

drupal_get_path_alias($path, $path_language = '')
includes/path.inc, line 108

Description

Given an internal Drupal path, return the alias set by the administrator.

Parameters

$path An internal Drupal path.

$path_language An optional language code to look up the path in.

Return value

An aliased path if one was found, or the original path if no alias was found.

Code

<?php
function drupal_get_path_alias($path, $path_language = '') {
  $result = $path;
  if ($alias = drupal_lookup_path('alias', $path, $path_language)) {
    $result = $alias;
  }
  return $result;
}
?>
 
 

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.