Replace “Howdy, admin” in WordPress admin bar


/ Published in: PHP
Save to your folder(s)



Copy this code and paste it in your HTML
  1. function replace_howdy( $wp_admin_bar ) {
  2. $my_account=$wp_admin_bar->get_node('my-account');
  3. $newtitle = str_replace( 'Howdy,', 'Logged in as', $my_account->title );
  4. $wp_admin_bar->add_node( array(
  5. 'id' => 'my-account',
  6. 'title' => $newtitle,
  7. ) );
  8. }
  9. add_filter( 'admin_bar_menu', 'replace_howdy',25 );

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.