Please make sure to update to WPML 4.3.6 and check our list of Known Issues before reporting

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 thread is resolved. Here is a description of the problem and solution.

I want to translate the target of a link
You can wrap your code around this code

function ...some code... {
$my_current_lang = apply_filters( 'wpml_current_language', NULL );
if( $my_current_lang =='en' ) {
...some code...
elseif( $my_current_lang =='nl') {
...some code...
return $translated_text;

Relevant Documentation:


This topic contains 2 replies, has 2 voices.

Last updated by oscarM-16 5 months, 2 weeks ago.

Assigned support staff: Bruno Kos.

Author Posts
September 11, 2019 at 7:18 am #4551055


Tell us what you are trying to do? Translating the target of a link

Is there any documentation that you are following?

Is there a similar example that we can see?

What is the link to your site? hidden link

September 11, 2019 at 8:31 am #4551719

Bruno Kos

Languages: English (English )

Timezone: Europe/Zagreb (GMT+01:00)


I moved this into the ticket, since there was no reply for a long time. Can you tell me if you are able to code this as per my suggestion, so by using wpml_current_language filter?

Bruno Kos

September 11, 2019 at 10:57 am #4552803


Thanks for your help, works like a charm.