You are here

function hook_redirect_load in Redirect 8

Act on redirects being loaded from the database.

This hook is invoked during redirect loading, which is handled by entity_load(), via classes RedirectController and DrupalDefaultEntityController. After the redirect information is read from the database or the entity cache, hook_entity_load() is invoked on all implementing modules, and then 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 the entity cache). 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

./redirect.api.php, line 81
Hooks provided by the Redirect module.

Code

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