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 3 replies, has 3 voices.

Last updated by longT-2 6 years, 1 month ago.

Assigned support staff: Harshad.

Author Posts
July 9, 2013 at 8:31 am #142747

Neil

Is it possible to get all other translated post IDs from a single post ID

For example I have an english post ID =1, using that ID can I pull back the translations in french and italian?

Thanks

Neil Matthews

July 9, 2013 at 9:24 am #142779

Harshad

Dear Neil,

Yes you can use icl_object_id function to get the post ID in other language.
For ex.

$id = icl_object_id(1,'post',false,ICL_LANGUAGE_CODE);
July 9, 2013 at 9:30 am #142791

Neil

{SLAPS FOREHEAD} 🙂 of course, then just repeat for each language required I was thinking of something far more complex

thanks

June 14, 2019 at 11:07 am #4020775

longT-2

Hi Harshad,

icl_object_id(...)

Can't be used in action hook, ex. add_action.
Do you know other similar functions?
Thanks