1 redirect.api.php hook_redirect_load(array &$redirects, $types)

Act on redirects being loaded from the database.

This hook is invoked during redirect loading, which is handled by redirect_load_multiple(). After the redirect information is read from the database hook_redirect_load() is invoked on all implementing modules.

This hook should only be used to add information that is not in the redirect table, not to replace information that is in that table (which could interfere with saving). For performance reasons, information for all available redirects should be loaded in a single query where possible.

The $types parameter allows for your module to have an early return (for efficiency) if your module only supports certain redirect types.

Parameters

$redirects: An array of the redirects being loaded, keyed by rid.

$types: An array containing the types of the redirects.

Related topics

File

core/modules/redirect/redirect.api.php, line 59
Hooks provided by the Redirect module.

Code

function hook_redirect_load(array &$redirects, $types) {

}