Last active
July 10, 2025 19:09
-
-
Save endurtech/d3eff716f4c142e4b5eb4e6cbbe3eccc to your computer and use it in GitHub Desktop.
This file contains hidden or 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 | |
| // Replace WordPress Admin Bar Welcome Message with Custom Text | |
| // Replaces the default 'Howdy' welcome text at the top right next to the logged in username with text of your own choosing. | |
| // https://endurtech.com/replace-wordpress-admin-bar-welcome-text-howdy/ | |
| add_action( 'wp_before_admin_bar_render', 'replace_howdy_text' ); | |
| function replace_howdy_text() | |
| { | |
| global $wp_admin_bar; | |
| $my_account = $wp_admin_bar->get_node( 'my-account' ); | |
| if ( ! $my_account || ! isset( $my_account->title ) ) | |
| { | |
| return; | |
| } | |
| $welcome_text = 'Hello,'; // Replace Hello with your custom Welcome text message. | |
| $new_title = str_replace( 'Howdy,', $welcome_text, $my_account->title ); | |
| $wp_admin_bar->add_node( array( | |
| 'id' => 'my-account', | |
| 'title' => $new_title, | |
| ) ); | |
| } | |
| ?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment