• Posted: 2012-01-20
  • Author: AxWax
  • Tags:

Replace “Howdy” in WordPress 3.3+ Admin Bar

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7.  
  8.  
  9.  
  10.  
  11.  
  12.  
<?php
// replace WordPress Howdy in WordPress 3.3
function replace_howdy( $wp_admin_bar ) {
    $my_account=$wp_admin_bar->get_node('my-account');
    $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 );
?>

Instructions:

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.


Related links:
http://www.redbridgenet.com/wordpress/how-to-replace-or-remove-wordpress-howdy/
http://wpdevel.wordpress.com/2011/12/07/admin-bar-api-changes-in-3-3/
Share this snippet

If you like this snippet, share it with friends!