Created
November 6, 2022 15:29
-
-
Save AndreFCAmorim/2d22d8d6da7f39dd79e3da6d92326fd5 to your computer and use it in GitHub Desktop.
Change "Howdy Admin" in Admin Bar on WordPress
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function wpcode_snippet_replace_howdy( $wp_admin_bar ) { | |
// Edit the line below to set what you want the admin bar to display intead of "Howdy,". | |
$new_howdy = 'Welcome,'; | |
$my_account = $wp_admin_bar->get_node( 'my-account' ); | |
$wp_admin_bar->add_node( | |
array( | |
'id' => 'my-account', | |
'title' => str_replace( 'Howdy,', $new_howdy, $my_account->title ), | |
) | |
); | |
} | |
add_filter( 'admin_bar_menu', 'wpcode_snippet_replace_howdy', 25 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment