调用未定义的方法 WP_Textdomain_Registry::reset()

Elo*_*uiz 12 php wordpress wpml

我的 WordPress 网站已损坏,仅显示以下错误消息:

Fatal error: Uncaught Error: Call to undefined method WP_Textdomain_Registry::reset() in /var/www/htdocs/wp-content/plugins/wpml-string-translation/classes/MO/Hooks/LanguageSwitch.php:139
Stack trace:
#0 /var/www/htdocs/wp-content/plugins/wpml-string-translation/classes/MO/Hooks/LanguageSwitch.php(119): WPML\ST\MO\Hooks\LanguageSwitch->resetTranslationAvailabilityInformation()
#1 /var/www/htdocs/wp-content/plugins/wpml-string-translation/classes/MO/Hooks/LanguageSwitch.php(73): WPML\ST\MO\Hooks\LanguageSwitch->changeMoObjects('view-subscripti...')
#2 /var/www/htdocs/wp-content/plugins/wpml-string-translation/classes/TranslateWpmlString.php(167): WPML\ST\MO\Hooks\LanguageSwitch->switchToLocale('view-subscripti...')
#3 /var/www/htdocs/wp-content/plugins/wpml-string-translation/classes/TranslateWpmlString.php(109): WPML\ST\Trans in /var/www/htdocs/wp-content/plugins/wpml-string-translation/classes/MO/Hooks/LanguageSwitch.php on line 139
Run Code Online (Sandbox Code Playgroud)

我只能在将“.disabled”添加到插件文件夹(wpml-string-translation)名称后才能访问该网站,但这会禁用该插件,并且该网站需要它才能工作。

小智 21

这是更新到 wordpress 6.1 时出现的问题。

要修复此问题,您需要将 WPML 更新到 4.5.12,将字符串翻译更新到 3.2.3

资料来源:https ://wpml.org/changelog/2022/10/wpml-4-5-12-updates-for-wordpress-6-1/

- 编辑:

下载两个更新的插件后,将与插件相关的两个文件夹重命名并安装更新版本即可解决问题


小智 7

我刚刚删除了字符串 139。目前一切正常