Last active
March 6, 2019 16:57
-
-
Save ellegaarddk/75f61772f1a137cfd46a5079324061bb to your computer and use it in GitHub Desktop.
Show default version if translation isn't found
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
<?php | |
add_filter('icl_ls_languages', 'wpml_ls_filter'); | |
function wpml_ls_filter($languages) { | |
global $sitepress; | |
$default_url = $languages[$sitepress->get_default_language()]['url']; | |
foreach($languages as $lang_code => $language){ | |
if($languages[$lang_code]['missing']==1){ | |
$languages[$lang_code]['url'] = $default_url; | |
} | |
} | |
return $languages; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment