问题概述
如果您使用的是 Business Directory Plugin,您将无法翻译列表图像。当尝试通过 WPML Media Translation 翻译图像,或在列表的翻译版本中手动更改图像时,前端仍会显示原始语言图像。
临时解决方法
请在继续操作之前,确保对您的站点进行完整备份。
- 安装 WPML Media Translation 插件。
- 前往 WPML媒体翻译 页面。
- 翻译图像。
- 打开 …/wp-content/plugins/business-directory-plugin/includes/helpers/functions/templates-ui.php 文件。
- 找到第 534 行。
- 在
wp_get_attachment_image()调用中,替换第一个参数$main_image->ID:$main_image->ID,
- 替换为:
apply_filters( 'wpml_object_id', $main_image->ID, 'attachment' ),