I am trying to: I need to get the attachment_id of custom field through Rest API of custom post, all things are working well till I activated the WPML plugin. I figure out that this is related to translated custom post type (after translation of the post to second language, the attachment_id will again appear).
Link to a page where the issue can be seen: dev environment
I expected to see:
I expect to get the attachment_id of the custom field regardless of the translation. Our Customer want to add the second language sometimes later.
Instead, I got:
before WPML -> attachment ID is correct
after WPML (without translation of post) -> attachment_id is null (url is in but I need the attachment_id)
after post translation -> attachement_id is again set (only If I don't translate the post with duplicate function)
Hi there,
Would you please follow the steps below and see if it fixes the issue?
- Go to "WordPress Dashboard > WPML > Settings > Media Translation".
- Make sure that all the enabled checkboxes there are checked.
- Click the "Start" button.
- Wait for the process to finish.
Thanks.
Hey Christropher,
thanks for your Feedback, we already tried something in this direction.
The Problem is:
In this Case the Second language is in progress (content will be added later or with delay) as long as the second language is not created the attachment ID of "main" language is null. In my opinion, this cant be right?
Thanks.
Hi there,
Let's see if this can be replicated on a clean installation so that I can report this to the development team.
I created a clean installation of Toolset and WPML:
hidden link
I'd appreciate it if you can add a custom field and a sample post and replicate the issue with your code so that we can investigate this further.
Thanks.
Hey Christopher,
can you please setup a new sandbox ?
Thanks.
Hi there
Sure, here is the Sandbox:
hidden link
Please make sure that you replicate the issue within seven days. If not, the Sandbox will be deleted automatically.
Thanks.