• Hi there,

    I’m having an issue where every time I make a translated version of a post all the attached images of that post don’t come across. I’m thinking it’s something to do with the links of the attachments not being preserved during the duplication from the parent post. So is there some sort of Filter or hook I can use to preserve the attachments?

    It’s used inside of a custom post type with that previously mentioned filter already added so it can be translated.

    I have also tried resetting the permalinks and that still doesn’t fix the issue.

    • This topic was modified 7 years, 10 months ago by trentmarino.
Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Takayuki Miyoshi

    (@takayukister)

    I’m not sure what you are seeing. What contents do you have in the CPT posts? And how do they rendered (the front-end URLs)?

    Thread Starter trentmarino

    (@trentmarino)

    The CPT post includes a range of images and text. The images get added to a gallery with a slideshow. On the English version of the page, the images appear and everything works fine, so it doesn’t seem like its the gallery plugin, but when I go to the translated page it shows nothing.

    In the editor when you go to the add media button and click on the dropdown and go to “uploaded to this post” option it says “No items found”. So it seems like the links to the attachments aren’t coming across from the parent.

    • This reply was modified 7 years, 10 months ago by trentmarino.
    • This reply was modified 7 years, 10 months ago by trentmarino.

    To clarify, the issue we are experiencing is that image attachments aren’t preserved with translations.

    For example, we have a website where images are that are uploaded to a post via the Media Library (but not necessarily used in the post content), are pulled via a query to get_attached_media() and used to build a gallery.

    When translating a post, those image attachments are not preserved. You can test this by the following steps:

    1. Create a new post and select ‘Add Media’
    2. Upload an image, but don’t select it. Just close the media library.
    3. Return to media library and use the filters at the top to select ‘Uploaded to this post.’
    4. You can see the attached image.
    5. Translate the post and select ‘Add Media’.
    6. Filter by ‘Uploaded to this post’, you will see no attached media.

    I realise this may be an edge case and that the current setup may even be desired behaviour, however perhaps you could make it an option to preserve media attachments on translate?

    Or even give us a hint in the right direction about how we might manage this ourselves with a filter etc, I am a reasonably competent WP developer.

    Thanks,
    Jamie

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Images in translated CPT posts don’t come accross’ is closed to new replies.