WPML get all languages names
/** * v123 DEV * https://v123.tw */ function get_all_langs_names($lang='en'){ global $wpdb; $lang_data = array(); $languages = $wpdb->get_results( $wpdb->prepare( "SELECT code, english_name, active, tag, name FROM {$wpdb->prefix}icl_languages lang INNER JOIN {$wpdb->prefix}icl_languages_translations trans ON lang.code = trans.language_code AND trans.display_language_code=%s" , $lang ) ); foreach($languages as $l){ $lang_data[$l->code] = array( 'english_name' => $l->english_name, 'active' => $l->active, 'tag' => $l->tag, 'name' => $l->name, ); } return $lang_data; } print_r(get_all_langs_names());