Skip to content

Instantly share code, notes, and snippets.

@vanpariyar
Created December 19, 2019 07:52
Show Gist options
  • Star 4 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save vanpariyar/3112c09a9582cc9c356c32adb6ffa5e9 to your computer and use it in GitHub Desktop.
Save vanpariyar/3112c09a9582cc9c356c32adb6ffa5e9 to your computer and use it in GitHub Desktop.
[Sloved] Fatal error: Uncaught TypeError: Argument 1 passed to WPML_Media_Post_Images_Translation::translate_images_in_post_content()
Fatal error: Uncaught TypeError: Argument 1 passed to WPML_Media_Post_Images_Translation::translate_images_in_post_content() must be an instance of WP_Post, null given, called in /www/htdocs/w0184db4/helmut-kostner.it/wp-content/plugins/wpml-media-translation/classes/media-translation/class-wpml-media-post-images-translation.php on line 107 and defined in /www/htdocs/w0184db4/helmut-kostner.it/wp-content/plugins/wpml-media-translation/classes/media-translation/class-wpml-media-post-images-translation.php:130 Stack trace: #0 /www/htdocs/w0184db4/helmut-kostner.it/wp-content/plugins/wpml-media-translation/classes/media-translation/class-wpml-media-post-images-translation.php(107): WPML_Media_Post_Images_Translation->translate_images_in_post_content(NULL, Object(WPML_Post_Element)) #1 /www/htdocs/w0184db4/helmut-kostner.it/wp-includes/class-wp-hook.php(288): WPML_Media_Post_Images_Translation->translate_images(5) #2 /www/htdocs/w0184db4/helmut-kostner.it/wp-includes/class-wp-hook.php(310): WP_Hook->apply_filters(NULL, Array) in /www/htdocs/w0184db4/helmut-kostner.it/wp-content/plugins/wpml-media-translation/classes/media-translation/class-wpml-media-post-images-translation.php on line 130
Solution:
It is recommend to perform a cleanup of WPML translations with the following steps:
1. Go to WPML > Support > Troubleshooting
2. Click on the button "Remove ghost entries from the translation tables".
@fitodac
Copy link

fitodac commented Jan 6, 2022

[sloved] should be say solved? thank you for your solution. Works perfectly.

@vanpariyar
Copy link
Author

@fitodac Happy to here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment