- 状态
- 已解决
- 报告针对
- WPML Media Translation 2.5.6
- 解决于
- 2.6.0
问题概述
如果您发送包含多张图片的页面进行翻译,并且从媒体库中删除了一些图片,那么在翻译成其他语言时可能会遇到问题。
另一种可能会产生相同结果的情况是,图片说明的简码中包含空的 ID——例如 。
临时解决方法
wp-content/plugins/wpml-media-translation/classes/media-translation/class-wpml-media-post-images-translation.php
将:
$new_caption_shortcode = $this->replace_caption_id_with_translated_id( $new_caption_shortcode, $attachment_id, $language );
替换为:
if ($attachment_id !== NULL) {
$new_caption_shortcode = $this->replace_caption_id_with_translated_id(
$new_caption_shortcode,
$attachment_id,
$language
);
}