Last active
December 16, 2015 12:28
-
-
Save opi/5434701 to your computer and use it in GitHub Desktop.
Mimic drupal rabbithole module
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| function mymodule_node_view($node, $view_mode, $langcode) { | |
| // Mimic rabbit-hole module | |
| if (node_is_page($node)) { | |
| // Access denied: | |
| drupal_access_denied(); | |
| drupal_exit(); | |
| // Page not found: | |
| drupal_not_found(); | |
| drupal_exit(); | |
| // Redirect | |
| $url = ''; | |
| drupal_goto($url); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment