Created
November 20, 2015 16:45
-
-
Save ricardokdz/3887004af759619b7c88 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- Languages --> | |
<select onchange="javascript:location.href = this.value;"> | |
<?php | |
$langs = icl_get_languages('skip_missing=0&orderby=KEY&order=DIR&link_empty_to=#notranslation'); | |
foreach($langs as $lang): | |
$str = $lang['native_name'] === $lang['translated_name'] ? $lang['native_name'] : $lang['translated_name'] . ' (' . $lang['native_name'] . ')'; | |
?> | |
<option value="<?php echo $lang['url'] ?>" <?php if($lang['active']): ?>selected="selected"<?php endif; ?>><?php echo $str ?></option> | |
<?php endforeach; ?> | |
</select> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment