Created
September 3, 2013 00:01
-
-
Save cafuego/6418333 to your computer and use it in GitHub Desktop.
mess with Drupal 7 status messages
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
/** | |
* Implements hook_preprocess_status_messages(). | |
* | |
* Remove the login warning message, anon users can only see the login form anyway. | |
*/ | |
function intranet_preprocess_status_messages(&$vars) { | |
$messages = drupal_get_messages('error'); | |
if (!empty($messages['error'])) { | |
$errors = $messages['error']; | |
foreach ($errors as $error) { | |
if ($error == t('Access denied. You may need to login below or register to access this page.')) { | |
continue; | |
} | |
drupal_set_message($error, 'error'); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment