WPML
状态
已解决
解决于
4.5.0
相关插件/主题
Divi

问题概述

当您在 Divi 模块中添加指向媒体链接(例如 PDF 文件)的动态内容并翻译该模块时,翻译后的链接将不会指向翻译后的媒体,并且会返回 404 错误。

临时解决方法

我们正在开发此问题的永久修复方案。同时,您可以按照以下步骤在您的网站上修复此问题:


  1. 备份您的网站文件和数据库。

  2. 前往 wp-content/themes/Divi/includes/builder/feature/dynamic-content.php

  3. 找到:
    $dynamic_content = json_decode( $json, true );


  4. 在该行之后,添加:
    if ($dynamic_content != NULL && $dynamic_content['settings']['post_id'] != NULL) {
    		$post_type                              = get_post_type( $dynamic_content["settings"]["post_id"] );
    		$dynamic_content["settings"]["post_id"] = apply_filters( 'wpml_object_id',
    			$dynamic_content['settings']['post_id'], $post_type, true );
    	}

所有已知问题 →