WordPress.org

Plugin Directory

Changeset 553466


Ignore:
Timestamp:
06/05/12 16:58:51 (23 months ago)
Author:
ramon fincken
Message:

New version

Location:
wpml-flag-in-menu
Files:
5 added
2 edited

Legend:

Unmodified
Added
Removed
  • wpml-flag-in-menu/trunk/readme.txt

    r510741 r553466  
    44Tags: wpnav,nav,wp_nav_menu,menu,header,view,wpml,flag,show,language,languages 
    55Requires at least: 2.0.2 
    6 Tested up to: 3.3.1 
    7 Stable tag: 1.0 
     6Tested up to: 3.3.2 
     7Stable tag: 1.1 
    88 
    99Shows translated flags (for every language except current viewing lang) in the default or wp_nav_menu at last position 
     
    1111== Description == 
    1212 
    13 Shows translated flags (for every language except current viewing lang) in the default or wp_nav_menu at last position 
     13Shows translated flags (for every language except current viewing lang) in the default or wp_nav_menu at last position.<br> 
     14wp_nav_menu = Appearance -> menus<br> 
     15LTR support 
    1416 
    1517<br> 
     
    3234== Changelog == 
    3335 
     36= 1.1 = 
     37* Added: LTR support. Thanks Simon Weil !<br> 
     38* Changed txt file 
     39 
    3440= 1.0 = 
    3541First release 
  • wpml-flag-in-menu/trunk/wpml_flag_in_menu.php

    r510735 r553466  
    44 Plugin URI: http://www.MijnPress.nl 
    55 Description: Shows translated flags (for every language except current viewing lang) in the default or wp_nav_menu at last position 
    6  Version: 1.0 
     6 Version: 1.1 
    77 Author: Ramon Fincken 
    88 Author URI: http://www.MijnPress.nl 
     
    1616    { 
    1717        $languages = icl_get_languages('skip_missing=0&orderby=code'); 
     18        $new_items = ''; 
    1819        if(!empty($languages)){ 
    1920            foreach($languages as $l){ 
     
    2122                if($l['language_code'] != ICL_LANGUAGE_CODE) 
    2223                { 
    23                     $items .= '<li class="menu-item menu-item-type-post_type menu-item-object-page">'; 
    24                     if(!$l['active']) $items .= '<a href="'.$l['url'].'">'; 
     24                    $new_items .= '<li class="menu-item menu-item-type-post_type menu-item-object-page">'; 
     25                    if(!$l['active']) $new_items .= '<a href="'.$l['url'].'">'; 
    2526                    if($l['country_flag_url']){ 
    26                         $items .= '<img src="'.$l['country_flag_url'].'" height="12" alt="'.$l['language_code'].'" width="18" />'; 
     27                        $new_items .= '<img src="'.$l['country_flag_url'].'" height="12" alt="'.$l['language_code'].'" width="18" />'; 
    2728                    } 
    2829                    // $items .= icl_disp_language($l['native_name'], $l['translated_name']); 
    29                     if(!$l['active']) $items .= '</a>'; 
    30                     $items .= '</li>'; 
     30                    if(!$l['active']) $new_items .= '</a>'; 
     31                    $new_items .= '</li>'; 
    3132                } 
    3233            } 
    3334        } 
    3435    } 
     36    // Idea by Simon Weil 
     37    if(is_rtl()) 
     38    { 
     39        $items = $new_items.$items; 
     40    } 
     41    else 
     42    { 
     43        $items .= $new_items; 
     44    } 
     45     
    3546    return $items; 
    3647} 
Note: See TracChangeset for help on using the changeset viewer.