WPML
状态
未解决
报告针对
WPML Multilingual CMS 4.6.7
相关插件/主题
Flux Checkout
主题标签
Bug, Compatibility

问题概述

如果您使用的是像Flux Checkout这样的插件,当激活WPML 字符串翻译插件并将管理后台语言切换为次要语言时,可能会发生致命错误:


Fatal error: Uncaught ValueError: Unknown format specifier "t" in .../wp-content/plugins/wpml-string-translation/classes/translations-file-scan/wpml-st-translations-file-registration.php:100

临时解决方法

在继续操作之前,请确保已对站点进行完整备份


  • 打开 …/wp-content/plugins/wpml-string-translation/classes/translations-file-scan/wpml-st-translations-file-registration.php 文件。

  • 在以下代码行之后:
    	private function get_file_path_pattern( $file_path, $original_domain ) {
    		$pathinfo  = pathinfo( $file_path );
    		$file_type = isset( $pathinfo['extension'] ) ? $pathinfo['extension'] : null;

  • 添加以下内容:
    $file_path = str_replace('%', '', $file_path);

所有已知问题 →