Skip to content

Instantly share code, notes, and snippets.

jhtjards / wpml_get_current_language_name.php
Last active November 1, 2023 10:21
The WPML constant ICL_LANGUAGE_NAME and others are deprecated in WPML v4.6.7. This is a replacement template function for that and more.
if ( ! function_exists( 'wpml_get_current_language_name' ) ) :
* Returns current active site language array.
* If the optional $arg is set, only the corresponding value is returned.
* $arg can be one of:
* code, id, native_name, major, active, default_locale,
* encode_url, tag, translated_name, url, country_flag_url, language_code