[Plugin: WPML flag in menu] correction to the flag position – rtl
-
Hi,
As I’m using an RTL language website,
I added functionality to put the flag at the right side of the menu.Here is the corrected code,
please update the plugin.function plugin_wpml_flag_in_menu($items, $args = NULL) { if(function_exists('icl_get_languages')) { $new_items = ''; $languages = icl_get_languages('skip_missing=0&orderby=code'); if(!empty($languages)){ foreach($languages as $l){ // Exclude current viewing language if($l['language_code'] != ICL_LANGUAGE_CODE) { $new_items .= '<li class="menu-item menu-item-type-post_type menu-item-object-page">'; if(!$l['active']) $new_items .= '<a href="'.$l['url'].'">'; if($l['country_flag_url']){ $new_items .= '<img src="'.$l['country_flag_url'].'" height="12" alt="'.$l['language_code'].'" width="18" />'; } // $new_items .= icl_disp_language($l['native_name'], $l['translated_name']); if(!$l['active']) $new_items .= '</a>'; $new_items .= '</li>'; } } } // Place the flags at the correct side of the menu according to the the language direction if (is_rtl()) { $items = $new_items.$items; } else { $items .= $new_items; } } return $items; } ?>
Thank you for a very helpful plugin!
Simon
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘[Plugin: WPML flag in menu] correction to the flag position – rtl’ is closed to new replies.