Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function wpml_get_languages ($options = 'skip_missing=1&orderby=code&order=desc') {
- $languages = icl_get_languages($options);
- $currentID = get_queried_object_id();
- foreach ($languages as $key => $language) {
- $id = icl_object_id($currentID, 'page', false, $language['language_code']);
- $status = get_post_status($id);
- if ($status !== 'publish') {
- unset($languages[$key]);
- }
- }
- return array_values($languages);
- }
Add Comment
Please, Sign In to add comment