function hook_privatemsg_message_view_alter in Privatemsg 6
Same name and namespace in other branches
- 6.2 privatemsg.api.php \hook_privatemsg_message_view_alter()
- 7.2 privatemsg.api.php \hook_privatemsg_message_view_alter()
- 7 privatemsg.api.php \hook_privatemsg_message_view_alter()
Act on the $vars before a message is displayed.
This is called in the preprocess hook of the privatemsg-view template. The $message data is aviable in $vars['message'].
Parameters
$var: Template variables
Related topics
1 function implements hook_privatemsg_message_view_alter()
Note: this list is generated by pattern matching, so it may include some functions that are not actually implementations of this hook.
- pm_block_user_privatemsg_message_view_alter in pm_block_user/
pm_block_user.module - Implements hook_privatemsg_message_view_alter().
1 invocation of hook_privatemsg_message_view_alter()
File
- ./
privatemsg.api.php, line 343 - Privatemsg API Documentation
Code
function hook_privatemsg_message_view_alter(&$var) {
// add a link to each message
$vars['message_links'][] = array(
'title' => t('My link'),
'href' => '/path/to/my/action/' . $vars['message']['mid'],
);
}