Skip Navigation

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 1 reply, has 2 voices.

Last updated by Christopher Amirian 1 year, 8 months ago.

Author Posts
September 22, 2023 at 5:55 pm #14448533

joshM-12

I would like to know if it's possible to return the URL of the flag for the current language.

I have a button in the header that opens a popup with the full language switcher. I have that working, I just need the button to be the flag of the currently selected language.

September 25, 2023 at 6:20 am #14454487

Christopher Amirian
WPML Supporter since 07/2020

Languages: English (English )

Timezone: Asia/Yerevan (GMT+04:00)

Hi there,

Before this ticket is assigned to one of my colleagues I will give the initial answer.

There is no direct way to retrieve the flag image URLs, but you can use the WPML Hook below to get a lot of information about the active languages and int he array that it returns there is an item for the flag URL:

https://wpml.org/wpml-hook/wpml_active_languages/

Thanks.

The topic ‘[Closed] Return URL of flag for current language’ is closed to new replies.