php - 无法清除 gettext 缓存
问题描述
我正在玩gettext
WordPress 中的钩子并做了这样的事情:
add_filter("gettext", "test", 20, 3 );
function test($translation, $text, $domain) {
return "hello world";
}
正如预期的那样,WordPress 仪表板中的许多菜单项都更改为“hello world”。现在我不能把它们改回来。这是我尝试过的:
- 删除上面的代码块
functions.php
- 重启
php-fpm
- 重启
nginx
- 重新启动服务器
- 清除 WordPress 缓存(WP Super Cache)
我不确定还有什么可以尝试的。一些菜单项仍显示为“hello world”。奇怪的是,并非所有菜单项都卡住了,而且它似乎只发生在前端显示管理栏时(我在后端看不到任何“hello world”项目)。有任何想法吗?
解决方案
您是否尝试使用 删除过滤器remove_filter
,这里是代码:
// remove the filter
remove_filter( 'gettext', 'test', 20, 3 );
如果一切顺利,请告诉我。
推荐阅读
- ios - 对 Apple 的自动更新订阅的 verifyReceipt JSON 感到困惑
- r - 如何在 echarts4r 日历中设置本地月份名称
- laravel - 数据数组无法使用 Laravel 保存到 dababase
- node.js - 例如,通过 WebRTC 产生的数据流量是否在 Heroku 等平台上测量?
- perl - Linux 操作系统从 RHEL6 升级到 RHEL7 后,我们无法访问 CGI perl 应用程序
- pine-script - 为什么这段代码不能在 Pine Script 中运行?“未声明的标识符”错误
- python - 计算上一次发生
- php - 从String中删除换行后的双倍空格和空格
- amazon-web-services - 如何为 aws_lambda_permission 构造导入命令
- oracle - 如何添加通知