Welcome Prefix

function replace_prefix( $wp_admin_bar ) {
 $my_account=$wp_admin_bar->get_node('my-account');
 $newtitle = str_replace( 'Hi,', 'Logged in as', $my_account->title );
 $wp_admin_bar->add_node( array(
 'id' => 'my-account',
 'title' => $newtitle,
 ) );
 }
 add_filter( 'admin_bar_menu', 'replace_prefix',25 );

It’s the little things that make me happy. Like controlling the WordPress prefix to the username in the admin bar. Here from a simple “Hi” to a “Logged in as” notification.