- 状态
- 已解决
- 解决于
- 3.0.1
问题概述
如果您的站点运行的 WordPress 版本低于 5.0,您可能会遇到与 wp_script_translations 函数相关的 PHP 错误。
发生这种情况是因为该函数是在 WordPress 5.0 中引入的,因此早期版本无法找到它。
临时解决方法
这将在下一个 WPML 修补版本中得到修复。在此期间,您可以安全地注释掉(或完全删除)../wp-content/plugins/wpml-string-translation/classes/translations-file-scan/UI/文件夹中UI.php文件的第70行。
删除以下行:
wp_set_script_translations( $handle, 'wpml-string-translation', WPML_ST_PATH . "/locale/jed/$handle" );