Commit 88f026eb authored by webchick's avatar webchick

Issue #2228795 by Gaelan | eojthebrave: Where did hook_url_outbound_alter go?.

parent 1104509d
...@@ -2439,36 +2439,6 @@ function hook_system_themes_page_alter(&$theme_groups) { ...@@ -2439,36 +2439,6 @@ function hook_system_themes_page_alter(&$theme_groups) {
} }
} }
/**
* Alters outbound URLs.
*
* @param $path
* The outbound path to alter, not adjusted for path aliases yet. It won't be
* adjusted for path aliases until all modules are finished altering it. This
* may have been altered by other modules before this one.
* @param $options
* A set of URL options for the URL so elements such as a fragment or a query
* string can be added to the URL.
* @param $original_path
* The original path, before being altered by any modules.
*
* @see url()
*/
function hook_url_outbound_alter(&$path, &$options, $original_path) {
// Use an external RSS feed rather than the Drupal one.
if ($path == 'rss.xml') {
$path = 'http://example.com/rss.xml';
$options['external'] = TRUE;
}
// Instead of pointing to user/[uid]/edit, point to user/me/edit.
if (preg_match('|^user/([0-9]*)/edit(/.*)?|', $path, $matches)) {
if (\Drupal::currentUser()->id() == $matches[1]) {
$path = 'user/me/edit' . $matches[2];
}
}
}
/** /**
* Provide replacement values for placeholder tokens. * Provide replacement values for placeholder tokens.
* *
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment