- 状态
- 已解决
- 解决于
- 2.6.4
问题概述
当尝试将包含图像的文章添加到翻译篮时,您可能会遇到类似以下的致命错误:
PHP Fatal error: Uncaught InvalidArgumentException: Argument ID must be numeric and greater than 0. in /wp-content/plugins/sitepress-multilingual-cms/classes/translations/class-wpml-translation-element.php:29
临时解决方法
在添加此临时修复之前,请确保您有网站的可用备份:
前往:wp-content/plugins/wpml-media-translation/classes/media-translation/class-wpml-media-post-with-media-files.php
在该文件中,于以下代码行之前:
return apply_filters( 'wpml_ids_of_media_used_in_post', $media_ids, $this->post_id );
添加以下代码行:
$media_ids = \WPML\FP\Fns::filter( 'get_post', $media_ids );