Skip to content

Instantly share code, notes, and snippets.

@amitaibu
Created December 24, 2012 15:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save amitaibu/4369679 to your computer and use it in GitHub Desktop.
Save amitaibu/4369679 to your computer and use it in GitHub Desktop.
/**
* Implements hook_views_pre_render().
*/
function message_views_pre_render(&$view) {
if ($view->base_table != 'message' || empty($view->result[0]->mid)) {
// Not a message view, or no results with message ID.
return;
}
$mids = array();
foreach ($view->result as $row) {
$mids[] = $row->mid;
}
message_load_multiple($mids);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment