Redirect API Hooks in Redirect 7.2
Same name and namespace in other branches
- 8 redirect.api.php \redirect_api_hooks
- 7 redirect.api.php \redirect_api_hooks
During redirect operations (create, update, view, delete, etc.), there are several sets of hooks that get invoked to allow modules to modify the redirect operation:
- All-module hooks: Generic hooks for "redirect" operations. These are always invoked on all modules.
- Entity hooks: Generic hooks for "entity" operations. These are always invoked on all modules.
Here is a list of the redirect and entity hooks that are invoked, and other steps that take place during redirect operations:
- Creating a new redirect (calling redirect_save() on a new redirect):
- hook_redirect_presave() (all)
- Redirect written to the database
- hook_redirect_insert() (all)
- hook_entity_insert() (all)
- Updating an existing redirect (calling redirect_save() on an existing redirect):
- hook_redirect_presave() (all)
- Redirect written to the database
- hook_redirect_update() (all)
- hook_entity_update() (all)
- Loading a redirect (calling redirect_load(), redirect_load_multiple(), or
entity_load() with $entity_type of 'redirect'):
- Redirect information is read from database.
- hook_entity_load() (all)
- hook_redirect_load() (all)
- Deleting a redirect (calling redirect_delete() or redirect_delete_multiple()):
- Redirect is loaded (see Loading section above)
- Redirect information is deleted from database
- hook_redirect_delete() (all)
- hook_entity_delete() (all)
- Preparing a redirect for editing (note that if it's
an existing redirect, it will already be loaded; see the Loading section
above):
- hook_redirect_prepare() (all)
- Validating a redirect during editing form submit (calling
redirect_form_validate()):
- hook_redirect_validate() (all)
File
- ./
redirect.api.php, line 8 - Hooks provided by the Redirect module.
Functions
Name | Location | Description |
---|---|---|
hook_redirect_access |
./ |
Control access to a redirect. |
hook_redirect_alter |
./ |
Act on a redirect being redirected. |
hook_redirect_delete |
./ |
Respond to redirect deletion. |
hook_redirect_hash_alter |
./ |
Alter the hash of a redirect. |
hook_redirect_insert |
./ |
Respond to creation of a new redirect. |
hook_redirect_load_alter |
./ |
Act on redirects being loaded from the database. |
hook_redirect_load_by_source_alter |
./ |
Alter the list of redirects matching a certain source. |
hook_redirect_prepare |
./ |
Act on a redirect object about to be shown on the add/edit form. |
hook_redirect_presave |
./ |
Act on a redirect being inserted or updated. |
hook_redirect_update |
./ |
Respond to updates to a redirect. |
hook_redirect_validate |
./ |
Perform redirect validation before a redirect is created or updated. |