Unable to clear gettext cache

Viewed 315

I was playing around with the gettext hook in WordPress and did something like this:

add_filter("gettext", "test", 20, 3 );
function test($translation, $text, $domain) {
    return "hello world";
}

As expected, many of the menu items in the WordPress dashboard changed to "hello world". Now I can't change them back. Here's what I've tried:

  1. Removing the code block above from functions.php
  2. Restarting php-fpm
  3. Restarting nginx
  4. Restarting the server
  5. Clearing WordPress cache (WP Super Cache)

I'm not really sure what else to try. Some menu items are still showing up as "hello world". Oddly, not all menu items are stuck, and it seems to only happen when the admin bar is being displayed on the front end (I don't see any "hello world" items on the back end). Any ideas?

1 Answers

Have you tried to remove the filter with remove_filter, here is the code:

// remove the filter 
remove_filter( 'gettext', 'test', 20, 3 ); 

Let me know if it goes ok, please.

Related