I got some comments on my previous blog post from my website user regarding tot the WordPress question. Here is the question How to Change the “Howdy” message to “Welcome” in WordPress admin dashboard. I think to create a separate tutorial for this topic and share the this with that user.
Want to change the WordPress default message “Howdy” to something else like “Welcome”, then keep your close attention in this tutorial. There are two options to do change the “Howdy” message to “Welcome” in admin dashboard area.
Use the below function to change the “Howdy” message to “Welcome”.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 |
$nohowdy = "Welcome"; if (is_admin()) { add_action('init', 'artdev_nohowdy_h'); add_action('admin_footer', 'artdev_nohowdy_f'); } // Load jQuery function artdev_nohowdy_h() { wp_enqueue_script('jquery'); } // Modify function artdev_nohowdy_f() { global $nohowdy; echo < <<JS <script type="text/javascript"> //< ![CDATA[ var nohowdy = "$nohowdy"; jQuery('#user_info p') .html( jQuery('#user_info p') .html() .replace(/Howdy/,nohowdy) ); //]]> JS; } |
You can also change the howdy message by using the gettext
filter.
1 2 3 4 5 6 7 8 9 10 11 12 |
add_filter('gettext', 'change_howdy', 10, 3); function change_howdy($translated, $text, $domain) { if (!is_admin() || 'default' != $domain) return $translated; if (false !== strpos($translated, 'Howdy')) return str_replace('Howdy', 'Welcome', $translated); return $translated; } |
If you like FreeWebMentor and you would like to contribute, you can write an article and mail your article to [email protected] Your article will appear on the FreeWebMentor main page and help other developers.
Article Tags: wordpress tutorial, wordpress tutorial for beginner, wordpress tutorial for beginners, wordpress tutorials, wordpress tutorials for beginners, wordpress tutorils