Skip Navigation

[Resolved] To get a link / ID of translation for custom post

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Karachi (GMT+05:00)

This topic contains 1 reply, has 2 voices.

Last updated by Waqar 1 year, 1 month ago.

Assisted by: Waqar.

Author
Posts
#2648865

Tell us what you are trying to do?

I need to check if post has a translation and put link to existing translation on a view with a post.

WPML general link is not good for it as I need to get some additional information from the translation of the post to show on this block.

#2649157

Hi,

Thank you for contacting us and I'd be happy to assist.

WPML offers a number of hooks and filters which can be used to extract translated content information:
https://wpml.org/documentation/support/wpml-coding-api/wpml-hooks-reference

For your particular requirement, you can use the filters 'wpml_element_trid' and 'wpml_get_element_translations' in your custom code:
https://wpml.org/wpml-hook/wpml_element_trid/
https://wpml.org/wpml-hook/wpml_get_element_translations/

regards,
Waqar