- 状态
- 已解决
- 解决于
- 3.1.8
问题概述
- 完整错误提示:Notice: WP_Scripts::localize was called <strong>incorrectly</strong>. The <code>$l10n</code> parameter must be an array.
- 在 WordPress 5.7 版本中出现了一个新的提示
- 仅当您启用了 wp_debug 时,您才会看到此错误。
我们已了解此问题,并且已经有了修复方案,在不久后完成测试后,我们将发布包含正确修复方案的版本。
临时解决方法
此问题的修复程序即将发布。
以下是防止出现该提示的补丁:
编辑文件 wp-content/plugins/wpml-string-translation/classes/menus/theme-plugin-localization-ui/class-wpml-st-theme-plugin-localization-resources.php 的第 27 行,并将:
get_option( WPML_ST_Themes_And_Plugins_Updates::WPML_ST_ITEMS_TO_SCAN )
替换为:
get_option( WPML_ST_Themes_And_Plugins_Updates::WPML_ST_ITEMS_TO_SCAN, [] )