Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
project
drupal
Commits
88f026eb
Commit
88f026eb
authored
Apr 11, 2014
by
webchick
Browse files
Issue
#2228795
by Gaelan | eojthebrave: Where did hook_url_outbound_alter go?.
parent
1104509d
Changes
1
Hide whitespace changes
Inline
Side-by-side
core/modules/system/system.api.php
View file @
88f026eb
...
@@ -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.
*
*
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment