Same name and namespace in other branches
- 4.6.x includes/bootstrap.inc \drupal_get_messages()
- 5.x includes/bootstrap.inc \drupal_get_messages()
- 6.x includes/bootstrap.inc \drupal_get_messages()
- 7.x includes/bootstrap.inc \drupal_get_messages()
- 8.9.x core/includes/bootstrap.inc \drupal_get_messages()
Return all messages that have been set.
As a side effect, this function clears the message queue.
File
- includes/
bootstrap.inc, line 744 - Functions that need to be loaded on every Drupal request.
Code
function drupal_get_messages() {
if ($messages = drupal_set_message()) {
unset($_SESSION['messages']);
}
return $messages;
}