December 30, 201411 yr EDIT: Solved! Helps if you actually change the string to be edited in the code..... I hadn't noticed this before, but the admin bar text in the WordPress dashboard now says 'How are you', instead of 'Howdy'. When did this change? Anyway, I have always had a custom welcome script setup to show a more personalised message; /* Change howdy text */ add_filter('gettext', 'roothost_change_howdy', 10, 3); function roothost_change_howdy($translated, $text, $domain) { $blogtime = current_time( 'mysql' ); list( $today_year, $today_month, $today_day, $hour, $minute, $second ) = split( '([^0-9])', $blogtime ); if ($hour <= 11){ $greet = "Good Morning"; } if ($hour >= 12 && $hour <= 16){ $greet = "Good Afternoon"; } if ($hour >= 17){ $greet = "Good Evening"; } if (!is_admin() || 'default' != $domain) return $translated; if (false !== strpos($translated, 'Howdy')) return str_replace('Howdy', $greet, $translated); return $translated; } /* End howdy text */ This has always worked as expected. Fast forward to this week, and I'm rebuilding my framework for a few new sites coming up in the next couple of weeks and noticed this is no longer working. I have stripped everything else out completely, and even tried the snippet on a fresh install of wordpress with the twentyfifteen theme. Still no joy! Presumably the hook, or filter has changed in recent versions. Anybody have a solution? Cheers!! Edited December 30, 201411 yr by roothost
Create an account or sign in to comment