Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
With the help of Berdir I was able to overwrite the output of the messages menu without losing the dynamic output of new messages.
What I did, was create my own custom module ( name module = MYMODULE ) where I added the following code.
// Privatemsg menu override
function MYMODULE_menu_alter(&$items) {
// Replace privatemsg_title_callback
$items['messages']['title callback'] = 'MYMODULE_title_callback';
}
function MYMODULE_title_callback() {
global $user;
if ($user) {
$count = privatemsg_unread_count($user);
}
else {
$count = privatemsg_unread_count();
}
if ($count > 0) {
return t('Inbox (' . $count . ')');
}
return t('Inbox');
}
Initial issue can be found here: http://drupal.org/node/1071734
Comments
Tweaked
[Edit: Just edited the HowTo instead]