This is the technical support forum for WPML - the multilingual WordPress plugin.

Everyone can read, but only WPML clients can post here. WPML team is replying on the forum 6 days per week, 22 hours per day.

This topic contains 6 replies, has 2 voices.

Last updated by alexisB-4 2 months, 1 week ago.

Assigned support staff: Marcos Vinicios Barreto.

Author Posts
July 29, 2019 at 3:22 pm

alexisB-4

I have a custom post type with a custom taxonomy. I use acf to link an image for each custom taxonomy item.
In the original language, $img = get_field( 'image', $subterm->taxonomy . '_' . $subterm->term_id ); returns an array, while in the translated language it returns the image ID

Link to a page where the issue can be seen:
hidden link

I expected to see: The image

Instead, I got: The image ID

July 31, 2019 at 2:51 am #4311363

Marcos Vinicios Barreto
Supporter

Languages: English (English ) Portuguese (Brazil) (Português )

Timezone: America/Bahia (GMT-03:00)

Hello,

Thank you for contacting WPML Support. I am jumping here to let you know I would need some extra hours to fully investigate and debug your issue. I will be back as soon as I have the full details and accurate answer for you. Thank you for your patience and understanding, have a nice day.

August 1, 2019 at 1:42 pm #4322427

Marcos Vinicios Barreto
Supporter

Languages: English (English ) Portuguese (Brazil) (Português )

Timezone: America/Bahia (GMT-03:00)

Hello,

Thank you for your patience while waiting for a solution. I still need to investigate your issue into details as I had a complex and busy queue last days, please, provide us with the http authentication details in order to access your duplicator package. As regarding your issue itself, I found this resource in the ACF forums: hidden link it provides some more details on how to get the fields specific for the different languages. Please, try it and let me know if it helps, have a nice day.

August 2, 2019 at 11:40 am
August 2, 2019 at 7:38 pm #4332383

Marcos Vinicios Barreto
Supporter

Languages: English (English ) Portuguese (Brazil) (Português )

Timezone: America/Bahia (GMT-03:00)

Hello,

Thank you for the provided details. I was able to download your duplicator package properly, I will proceed with a website migration in order to inspect your issue into details. I will be back as soon as I have a detailed and accurate answer for you. Thank you for your continued patience and understanding, have a nice day.

August 5, 2019 at 7:12 am #4338421

alexisB-4

Hi,
I managed to somehow resolve my issue, but it is hack (kinda).
After I translated the taxonomy using wpml, i need to swicth the language, go to the taxonomy, and 'edit' each taxonomy item 1 by 1. I dont really have to edit the taxonomy, I just have to click on the update button, and the all works fine.
I have the same problem every time I translate a page.

August 8, 2019 at 3:46 pm #4364547

Marcos Vinicios Barreto
Supporter

Languages: English (English ) Portuguese (Brazil) (Português )

Timezone: America/Bahia (GMT-03:00)

Hello,

Thank you for the updates and sorry for the bit of waiting here. I took a detailed look in your website using the duplicator package, I noticed the issue only happens with the previous uploaded images, if you add a new category and then translate it, the field returns the image value specified in your field settings at WordPress Dashboard > Custom Fields > Fields Groups > Produits in your case an array value for all the languages, which means the code is working properly, the save action for the existing translated products categories seems to be the more effective and simple workaround for now. Have a nice day.

August 9, 2019 at 10:36 am #4369535

alexisB-4

My issue is resolved now. Thank you!