drupal_get_path_alias

Definition

drupal_get_path_alias($path)
includes/path.inc, line 97

Description

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

Parameters

$path An internal Drupal path.

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) {
  $result = $path;
  if ($alias = drupal_lookup_path('alias', $path)) {
    $result = $alias;
  }
  if (function_exists('custom_url_rewrite')) {
    $result = custom_url_rewrite('alias', $result, $path);
  }
  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.