function hook_rabbit_hole_response_alter in Rabbit Hole 2.x
Same name and namespace in other branches
- 8 rabbit_hole.api.php \hook_rabbit_hole_response_alter()
Alter the response after the plugin's performAction() is executed.
Parameters
\Symfony\Component\HttpFoundation\Response $response: The current action response.
\Drupal\Core\Entity\ContentEntityInterface $entity: The entity to apply rabbit hole behavior on.
1 invocation of hook_rabbit_hole_response_alter()
- BehaviorInvoker::processEntity in src/
BehaviorInvoker.php - Invoke a rabbit hole behavior based on an entity's configuration.
File
- ./
rabbit_hole.api.php, line 38 - Hooks provided by the Rabbit Hole module.
Code
function hook_rabbit_hole_response_alter(Response &$response, \Drupal\Core\Entity\ContentEntityInterface $entity) {
if ($response instanceof RedirectResponse) {
$response = new TrustedRedirectResponse('https://example.com');
}
}