function hook_redirect_load_by_source_alter in Redirect 7.2
Same name and namespace in other branches
- 8 redirect.api.php \hook_redirect_load_by_source_alter()
- 7 redirect.api.php \hook_redirect_load_by_source_alter()
Alter the list of redirects matching a certain source.
Parameters
$redirects: An array of redirect objects.
$source: The source request path.
$context: An array with the following key/value pairs:
- language: The language code of the source request.
- query: An array of the source request query string.
See also
Related topics
1 invocation of hook_redirect_load_by_source_alter()
- redirect_load_by_source in ./
redirect.module - Load multiple URL redirects from the database by {redirect}.source.
File
- ./
redirect.api.php, line 100 - Hooks provided by the Redirect module.
Code
function hook_redirect_load_by_source_alter(array &$redirects, $source, array $context) {
foreach ($redirects as $rid => $redirect) {
if ($redirect->source !== $source) {
// If the redirects to do not exactly match $source (e.g. case
// insensitive matches), then remove them from the results.
unset($redirects[$rid]);
}
}
}