The action hook
admin_bar_menu does the job. Here's what the comment in the core file says:
It includes the action "admin_bar_menu" which should be used to hook
in and add new menus to the admin bar. That way you can be sure that
you are adding at most optimal point, right before the admin bar is
rendered. This also gives you access to the $post global, among
'id' => 'my-item',
'parent' => 'top-secondary',
'title' => 'My Item',
'href' => '#',
'meta' => array(
'title' => __('My Item'),
You're gonna have to tweak a bit with it, because this code added the new item to the extreme left! I think examining the
$admin_bar variable should give you an idea how to add an item.
'parent' => 'top-secondary' adds the item on the left of 'Howdy...'! So I bet there are other such position values. I'm looking for them ;)
'parent' => 'new-content' adds the item in the
New > Post, Media etc menu.
'parent' => 'wp-logo-external' adds the item in the menu popped out from the WordPress logo on the extreme left.
I have written a blog post with all possible positions for the new item in the admin bar menu... If anyone interested please read here.