Browse Source

fix depr null on str_replace

windhamdavid 5 months ago
parent
commit
082d3d6752
1 changed files with 4 additions and 8 deletions
  1. 4 8
      functions.php

+ 4 - 8
functions.php

@@ -118,14 +118,10 @@ function lps24_footer_filter ($default) {
   return '';
   return '';
 }
 }
 
 
-add_filter( 'admin_bar_menu', 'lps24_replace_wordpress_howdy', 25 );
-function lps24_replace_wordpress_howdy( $wp_admin_bar ) {
-  $account = $wp_admin_bar->get_node('my-account');
-  $newtext = str_replace( 'Howdy,', '', $account->title );
-  $wp_admin_bar->add_node( array(
-    'id' => 'my-account',
-    'title' => $newtext,
-  ));
+add_filter('gettext', 'lps24_replace_howdy', 10, 3);
+function lps24_replace_howdy($translated_text, $text, $domain) {
+  $new_message = str_replace('Howdy,', '', $text);
+  return $new_message;
 }
 }
 
 
 add_filter( 'gettext', 'lps24_change_howdy_text', 10, 2 );
 add_filter( 'gettext', 'lps24_change_howdy_text', 10, 2 );