Replace “Howdy” in WordPress 3.3+ Admin Bar

As previous methods for replacing “Howdy” in the WordPress backend don’t work with the new admin bar in WordPress 3.3 any more, here’s a short snippet that does.
This needs to be dropped into your theme’s functions.php file.

Code Snippet:

// replace WordPress Howdy in WordPress 3.3
function replace_howdy( $wp_admin_bar ) {
    $newtitle = str_replace( 'Howdy,', 'Logged in as', $my_account->title );            
    $wp_admin_bar->add_node( array(
        'id' => 'my-account',
        'title' => $newtitle,
    ) );
add_filter( 'admin_bar_menu', 'replace_howdy',25 );

Posted in Admin area