当前位置: 首页>>代码示例>>PHP>>正文


PHP icl_get_languages函数代码示例

本文整理汇总了PHP中icl_get_languages函数的典型用法代码示例。如果您正苦于以下问题:PHP icl_get_languages函数的具体用法?PHP icl_get_languages怎么用?PHP icl_get_languages使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了icl_get_languages函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: merge_comment_count

function merge_comment_count($count, $post_ID)
{
    // get all the languages for which this post exists
    $languages = icl_get_languages('skip_missing=1');
    $post = get_post($post_ID);
    $type = $post->post_type;
    foreach ($languages as $l) {
        // in $count is already the count from the current language
        if (!$l['active']) {
            $otherID = icl_object_id($post_ID, $type, false, $l['language_code']);
            if ($otherID) {
                // cannot use call_user_func due to php regressions
                if ($type == 'page') {
                    $otherpost = get_page($otherID);
                } else {
                    $otherpost = get_post($otherID);
                }
                if ($otherpost) {
                    // increment comment count using translation post comment count.
                    $count = $count + $otherpost->comment_count;
                }
            }
        }
    }
    return $count;
}
开发者ID:svenauhagen,项目名称:wpml-comments-merging,代码行数:26,代码来源:wpml-comments-merging.php

示例2: stormbringer_languages_switcher

function stormbringer_languages_switcher(){
    $languages = icl_get_languages('skip_missing=0&orderby=code');
    $inactives='';
    $actives='';
    if(!empty($languages)){
        echo '<div id="langswitcher"><div class="btn-group">';
        foreach($languages as $l) :
          if($l['active'])
            $actives='
              <button data-toggle="dropdown" class="btn dropdown-toggle">
              '.$l['language_code'].' <span class="caret"></span>
              </button>
              <ul class="dropdown-menu">
            ';
          else
            $inactives.= '
              <li>
                <a href="'.$l['url'].'" data-lang="'.$l['language_code'].'">'.$l['language_code'].'</a>
              </li>
            ';
        endforeach;
            
        echo $actives.$inactives;
        echo '</ul></div></div>';
    }
}
开发者ID:nicomollet,项目名称:stormbringer,代码行数:26,代码来源:wpml.php

示例3: st_update_default_settings

/**
 * Update to default settings
 */
function st_update_default_settings($check = false)
{
    $option_name = '_' . ST_NAME . '_is_import_default';
    if ($check === true) {
        if (get_option($option_name) == 'y') {
            return false;
        }
    }
    // default setting options
    $default = 'a:74:{s:6:"layout";s:1:"2";s:9:"site_logo";s:85:"http://demo.smooththemes.com/exposed/wp-content/themes/Exposed/assets/images/logo.png";s:12:"site_favicon";s:0:"";s:9:"body_font";a:8:{s:9:"font-size";s:2:"14";s:14:"font-size-unit";s:2:"px";s:11:"line-height";s:2:"24";s:16:"line-height-unit";s:2:"px";s:5:"color";s:0:"";s:11:"font-family";s:145:"http://fonts.googleapis.com/css?family=Lato:100%2C100italic%2C300%2C300italic%2Cregular%2Citalic%2C700%2C700italic%2C900%2C900italic&subset=latin";s:10:"font-style";s:6:"normal";s:11:"font-weight";s:6:"normal";}s:13:"headings_font";a:1:{s:11:"font-family";s:145:"http://fonts.googleapis.com/css?family=Lato:100%2C100italic%2C300%2C300italic%2Cregular%2Citalic%2C700%2C700italic%2C900%2C900italic&subset=latin";}s:9:"heading_1";a:2:{s:9:"font-size";s:2:"32";s:14:"font-size-unit";s:2:"px";}s:9:"heading_2";a:2:{s:9:"font-size";s:2:"30";s:14:"font-size-unit";s:2:"px";}s:9:"heading_3";a:2:{s:9:"font-size";s:2:"18";s:14:"font-size-unit";s:2:"px";}s:9:"heading_4";a:2:{s:9:"font-size";s:2:"18";s:14:"font-size-unit";s:2:"px";}s:9:"heading_5";a:2:{s:9:"font-size";s:2:"16";s:14:"font-size-unit";s:2:"px";}s:9:"heading_6";a:2:{s:9:"font-size";s:2:"14";s:14:"font-size-unit";s:2:"px";}s:17:"select_theme_skin";s:4:"dark";s:25:"enable_custom_global_skin";s:1:"n";s:18:"custom_global_skin";s:6:"fff200";s:12:"container_bg";s:0:"";s:20:"container_bg_opacity";s:0:"";s:12:"border_color";s:6:"343434";s:26:"gallery_item_hover_opacity";s:3:"0.6";s:7:"bg_type";s:7:"default";s:10:"defined_bg";s:12:"pattern3.png";s:16:"defined_bg_color";s:6:"c71c77";s:8:"bg_color";s:0:"";s:6:"bg_img";s:0:"";s:10:"bg_positon";s:2:"cc";s:10:"bg_repreat";s:1:"y";s:8:"bg_fixed";s:1:"y";s:21:"disable_header_custom";s:1:"y";s:17:"header_link_color";s:6:"ffffff";s:23:"header_link_hover_color";s:6:"ffffff";s:15:"header_bg_color";s:6:"000000";s:13:"header_bg_img";s:0:"";s:17:"header_bg_positon";s:0:"";s:17:"header_bg_repreat";s:0:"";s:15:"header_bg_fixed";s:0:"";s:13:"blog_toptitle";s:8:"The Blog";s:19:"s_show_featured_img";s:1:"y";s:16:"s_show_post_meta";s:1:"y";s:15:"s_show_post_tag";s:1:"y";s:18:"enable_author_desc";s:1:"y";s:15:"s_show_comments";s:1:"y";s:8:"facebook";s:2:"#f";s:7:"twitter";s:2:"#t";s:11:"google_plus";s:0:"";s:4:"digg";s:0:"";s:9:"pinterest";s:0:"";s:6:"flickr";s:7:"#flickr";s:16:"footer_copyright";s:115:"&copy; 2012. All Rights Reserved. Created with love by <a href=\\"http://www.smooththemes.com\\">SmoothThemes.Com</a>";s:14:"flex_animation";s:4:"fade";s:17:"flex_directionNav";s:1:"y";s:18:"flex_animationLoop";s:1:"y";s:14:"flex_slideshow";s:1:"y";s:19:"flex_slideshowSpeed";s:4:"7000";s:19:"flex_animationSpeed";s:3:"600";s:18:"flex_pauseOnAction";s:4:"true";s:17:"flex_pauseOnHover";s:1:"y";s:15:"flex_controlNav";s:1:"y";s:14:"flex_randomize";s:1:"n";s:20:"fixed_slideshowSpeed";s:4:"7000";s:20:"fixed_animationSpeed";s:3:"600";s:12:"fsc_autoplay";s:1:"y";s:13:"fsc_slideshow";s:1:"y";s:12:"fsc_interval";s:4:"6000";s:20:"fsc_transition_speed";s:3:"800";s:11:"gif_horizon";s:3:"0.6";s:8:"gif_size";s:3:"0.2";s:10:"gif_border";s:1:"0";s:21:"gkb_frames_per_second";s:2:"60";s:16:"gkb_display_time";s:4:"5000";s:13:"gkb_fade_time";s:4:"1000";s:8:"gkb_zoom";s:3:"1.2";s:18:"gflip_directionnav";s:1:"y";s:15:"gflip_thumbnail";s:1:"y";s:21:"headder_tracking_code";s:0:"";s:20:"footer_tracking_code";s:0:"";}';
    $translate = 'YTo1OTp7czo2OToiVGhpcyBwb3N0IGlzIHBhc3N3b3JkIHByb3RlY3RlZC4gRW50ZXIgdGhlIHBhc3N3b3JkIHRvIHZpZXcgY29tbWVudHMuIjtzOjA6IiI7czoxMjoiTm8gUmVzcG9uc2VzIjtzOjA6IiI7czoxMjoiT25lIFJlc3BvbnNlIjtzOjA6IiI7czoxMToiJSBSZXNwb25zZXMiO3M6MDoiIjtzOjE0OiJPbGRlciBDb21tZW50cyI7czowOiIiO3M6MTQ6Ik5ld2VyIENvbW1lbnRzIjtzOjA6IiI7czoyOiJ0byI7czowOiIiO3M6MjA6IkNvbW1lbnRzIGFyZSBjbG9zZWQuIjtzOjA6IiI7czoxOToiTGVhdmUgYSBSZXBseSB0byAlcyI7czowOiIiO3M6MTE6IllvdSBtdXN0IGJlIjtzOjA6IiI7czoxODoidG8gcG9zdCBhIGNvbW1lbnQuIjtzOjA6IiI7czoyOToiUmVxdWlyZWQgZmllbGRzIGFyZSBtYXJrZWQgJXMiO3M6MDoiIjtzOjEzOiJMZWF2ZSBhIFJlcGx5IjtzOjA6IiI7czoxMjoiQ2FuY2VsIFJlcGx5IjtzOjA6IiI7czoxMjoiUG9zdCBDb21tZW50IjtzOjA6IiI7czo3OiJDb21tZW50IjtzOjA6IiI7czo1NzoiWW91IG11c3QgYmUgPGEgaHJlZj0iJXMiPmxvZ2dlZCBpbjwvYT4gdG8gcG9zdCBhIGNvbW1lbnQuIjtzOjA6IiI7czo0MToiWW91ciBlbWFpbCBhZGRyZXNzIHdpbGwgbm90IGJlIHB1Ymxpc2hlZC4iO3M6MDoiIjtzOjQ6Ik5hbWUiO3M6MDoiIjtzOjU6IkVtYWlsIjtzOjA6IiI7czo3OiJXZWJzaXRlIjtzOjA6IiI7czoyMToidHlwZSBhbmQgaGl0IGVudGVyLi4uIjtzOjA6IiI7czo2OiJTZWFyY2giO3M6MDoiIjtzOjc6IlBhZ2UgJXMiO3M6MDoiIjtzOjE1OiJQZXJtYWxpbmsgdG8gJXMiO3M6MDoiIjtzOjM6IkFsbCI7czowOiIiO3M6OToiTG9hZGluZy4uIjtzOjA6IiI7czo5OiJMb2FkIG1vcmUiO3M6MDoiIjtzOjg6IkRhdGU6ICVzIjtzOjA6IiI7czo4OiJUYWdzOiAlcyI7czowOiIiO3M6MzoiLi4uIjtzOjA6IiI7aTo0MDQ7czowOiIiO3M6MTU6IkdvIHRvIEhvbWUgcGFnZSI7czowOiIiO3M6MTk6Im9yIHNlYXJjaCB0aGlzIHNpdGUiO3M6MDoiIjtzOjE5OiJBdXRob3IgQXJjaGl2ZXM6ICVzIjtzOjA6IiI7czoxMToiU2VhY2ggZm9yIDoiO3M6MDoiIjtzOjE4OiJEYWlseSBBcmNoaXZlczogJXMiO3M6MDoiIjtzOjIwOiJNb250aGx5IEFyY2hpdmVzOiAlcyI7czowOiIiO3M6MzoiRiBZIjtzOjA6IiI7czoxOToiWWVhcmx5IEFyY2hpdmVzOiAlcyI7czowOiIiO3M6MToiWSI7czowOiIiO3M6MTM6IkJsb2cgQXJjaGl2ZXMiO3M6MDoiIjtzOjIxOiJPb3BzLCBQYWdlIG5vdCBmb3VuZC4iO3M6MDoiIjtzOjY6IlBhZ2VzOiI7czowOiIiO3M6OToiTmV4dCBwYWdlIjtzOjA6IiI7czoxMzoiUHJldmlvdXMgcGFnZSI7czowOiIiO3M6NToiVGFnczoiO3M6MDoiIjtzOjk6IjAgQ29tbWVudCI7czowOiIiO3M6OToiMSBDb21tZW50IjtzOjA6IiI7czoxMDoiJSBDb21tZW50cyI7czowOiIiO3M6NToiU2hhcmUiO3M6MDoiIjtzOjE4OiJBdXRob3IgRGVzY3JpcHRpb24iO3M6MDoiIjtzOjk6IllvdXIgTmFtZSI7czowOiIiO3M6ODoicmVxdWlyZWQiO3M6MDoiIjtzOjE5OiJZb3VyIEUtTWFpbCBBZGRyZXNzIjtzOjA6IiI7czo3OiJTdWJqZWN0IjtzOjA6IiI7czo4OiJNZXNzYWdlOiI7czowOiIiO3M6MTA6IlN1Ym1pdCBOb3ciO3M6MDoiIjtzOjEzOiJSZWFkIG1vcmUg4oaSIjtzOjA6IiI7fQ==';
    $default = str_replace("'", "\\'", $default);
    $default = maybe_unserialize($default);
    $default['site_logo'] = st_img('logo.png');
    update_option(ST_SETTINGS_OPTION, $default);
    if (st_is_wpml()) {
        $langs = icl_get_languages('skip_missing=0&orderby=KEY&order=asc');
        foreach ($langs as $l) {
            update_option(ST_SETTINGS_OPTION . '_' . $l['language_code'], $default);
        }
    }
    // update translate options
    $translate = str_replace("'", "\\'", base64_decode($translate));
    $translate = maybe_unserialize($translate);
    update_option(ST_TRANSLATE_OPTION, $translate);
    update_option($option_name, 'y');
}
开发者ID:FameThemes,项目名称:exposed,代码行数:30,代码来源:st-active-theme.php

示例4: get_languages

 public static function get_languages($skip_missing = 0)
 {
     if (!self::exists()) {
         return;
     }
     return icl_get_languages('skip_missing=' . $skip_missing);
 }
开发者ID:brutalenemy666,项目名称:wp-utils,代码行数:7,代码来源:class-wpml.php

示例5: set_all_post_notices

 public function set_all_post_notices()
 {
     //$this->get_all_search_forms_wlang();
     if (Search_Filter_Helper::has_wpml() && defined('ICL_LANGUAGE_CODE')) {
         if (ICL_LANGUAGE_CODE == "all") {
             //this means a user has selected "all languages" - so loop loop through each language and check for errors - appending lang code
             $langs = icl_get_languages('skip_missing=0&orderby=KEY&order=DIR&link_empty_to=str');
             foreach ($langs as $lang) {
                 if (isset($lang['code'])) {
                     $search_form_ids = $this->get_all_search_forms_wlang($lang['code']);
                     $this->set_all_post_notices_wlang($search_form_ids, $lang['code']);
                 }
             }
             //reset current language - should be "all"
             global $sitepress;
             if (!empty($sitepress)) {
                 $sitepress->switch_lang(ICL_LANGUAGE_CODE);
             }
         } else {
             //user must be on a specifc language, let wpml filter the rest
             $search_form_ids = $this->get_all_search_forms_wlang();
             $this->set_all_post_notices_wlang($search_form_ids);
         }
     } else {
         $search_form_ids = $this->get_all_search_forms_wlang();
         $this->set_all_post_notices_wlang($search_form_ids);
     }
 }
开发者ID:alvarpoon,项目名称:aeg,代码行数:28,代码来源:class-search-filter-admin-notices.php

示例6: so_language_menu

 function so_language_menu()
 {
     if (function_exists('icl_get_languages')) {
         $languages = icl_get_languages('orderby=name&order=ASC');
         // you can change the parameters
         $counter = 0;
         if (!empty($languages)) {
             echo '<ul class="lang-nav">';
             foreach ($languages as $l) {
                 $counter += 1;
                 if ($l['active']) {
                     continue;
                 }
                 echo '<li id="' . $l['language_code'] . '">';
                 echo '<a href="' . $l['url'] . '">';
                 if ($l['language_code'] == 'en') {
                     echo 'EN';
                 } elseif ($l['language_code'] == 'zh-hans') {
                     echo urldecode('%E4%B8%AD%E6%96%87');
                 }
                 // Change this into any other language
                 echo '</a>';
                 if ($counter < sizeof($languages)) {
                     echo '&nbsp;|&nbsp;';
                 }
                 // optional line as a separator between languages
                 echo '</li>';
             }
             echo '</ul>';
         }
     }
 }
开发者ID:SpiritPixels,项目名称:Code-Snippets,代码行数:32,代码来源:simple-language-menu.php

示例7: wpml_languages_list

function wpml_languages_list($skip_missing = 0, $div_id = "footer_language_list")
{
    if (function_exists('icl_get_languages')) {
        $languages = icl_get_languages('skip_missing=' . intval($skip_missing));
        if (!empty($languages)) {
            echo '<div id="' . $div_id . '"><ul>';
            foreach ($languages as $l) {
                echo '<li>';
                if (!$l['active']) {
                    echo '<a href="' . $l['url'] . '">';
                }
                echo '<img src="' . $l['country_flag_url'] . '" alt="' . $l['language_code'] . '" />';
                if (!$l['active']) {
                    echo '</a>';
                }
                if (!$l['active']) {
                    echo '<a href="' . $l['url'] . '">';
                }
                echo $l['native_name'];
                if (!$l['active']) {
                    echo ' (' . $l['translated_name'] . ')';
                }
                if (!$l['active']) {
                    echo '</a>';
                }
                echo '</li>';
            }
            echo '</ul></div>';
        }
    }
}
开发者ID:StudioCreate,项目名称:Uncle-Hummer-WordPress-Theme,代码行数:31,代码来源:wpml-integration.php

示例8: gdlr_get_wpml_nav

    function gdlr_get_wpml_nav()
    {
        if (function_exists('icl_get_languages')) {
            ?>
<li class="gdlr-mega-menu">
	<a href="#"><i class="icon-globe"></i><?php 
            echo ICL_LANGUAGE_NAME;
            ?>
</a>
	<div class="sf-mega">
		<div class="sf-mega-section gdlr-wpml-language-selector">
		<?php 
            $languages = icl_get_languages('skip_missing=N&orderby=KEY&order=DIR&link_empty_to=str');
            foreach ($languages as $language) {
                echo '<div class="sub-menu-item">';
                echo '<img src="' . $language['country_flag_url'] . '" alt="" />';
                echo '<a href="' . $language['url'] . '" >' . $language['translated_name'] . '</a>';
                echo '</div>';
            }
            ?>
		</div>
	</div>
</li>
<?php 
        }
    }
开发者ID:kelscahill,项目名称:Northeast-Pride,代码行数:26,代码来源:wpml.php

示例9: display_language_menu_accordion

function display_language_menu_accordion()
{
    $menu = "";
    $languages = icl_get_languages('skip_missing=0&orderby=code');
    if (!empty($languages)) {
        $menu .= '<div class="ui inverted accordion">';
        $menu .= '<div class="active title">';
        $menu .= '<i class="dropdown icon"></i>';
        $menu .= __('Languages', 'sage');
        $menu .= '<i class="translate icon"></i>';
        $menu .= '</div>';
        $menu .= '<div class="active content">';
        foreach ($languages as $l) {
            if (!$l['active']) {
                $menu .= "<a class=\"item\" href=\"" . $l['url'] . "\">";
                $menu .= icl_disp_language($l['native_name'], $l['translated_name']);
                $menu .= '</a>';
            } else {
                $menu .= "<a class=\"item\" href=\"#\">";
                $menu .= icl_disp_language($l['native_name'], $l['translated_name']);
                $menu .= '</a>';
            }
        }
        $menu .= "</div>";
        $menu .= "</div>";
    }
    echo $menu;
}
开发者ID:gabzon,项目名称:experiensa,代码行数:28,代码来源:languages.php

示例10: pm_ln_icl_post_languages_mobile

function pm_ln_icl_post_languages_mobile()
{
    if (function_exists('icl_get_languages')) {
        $languages = icl_get_languages('skip_missing=1');
        if (1 < count($languages)) {
            echo '<div class="pm-micro-nav-lang-selector mobile">';
            echo '<div class="pm-dropdown pm-language-selector-menu">';
            echo '<div class="pm-dropmenu">';
            echo '<p class="pm-menu-title">' . __('Language', 'viennatheme') . '</p>';
            echo '<i class="fa fa-angle-down"></i>';
            echo '</div>';
            echo '<div class="pm-dropmenu-active">';
            echo '<ul>';
            foreach ($languages as $l) {
                if (!$l['active']) {
                    echo '<li><a href="' . $l['url'] . '">' . $l['translated_name'] . '</a></li>';
                }
            }
            echo '</ul>';
            echo '</div>';
            echo '</div>';
            echo '</div>';
            //echo join(', ', $langs);
        }
    }
    //end of check function
}
开发者ID:virendrayadav,项目名称:vinayakabags,代码行数:27,代码来源:wp-functions.php

示例11: add_htaccess_redirects

    public function add_htaccess_redirects($rules)
    {
        if (Load_Me_Quickly::get_option('plugin_activated') == 1) {
            $new_rules = '';
            //Check if WPML is installed and activated
            if (function_exists('icl_object_id')) {
                global $sitepress;
                $languages = icl_get_languages('skip_missing=1');
                foreach ($languages as $l) {
                    $sitepress->switch_lang($l['code'], true);
                    $new_rules .= self::add_htaccess_redirects_loop(true);
                }
            } else {
                $new_rules .= self::add_htaccess_redirects_loop(false);
            }
            if ($new_rules != '') {
                $rules = '

# Load Me Quickly
<IfModule mod_rewrite.c>
RewriteEngine on' . $new_rules . '
</IfModule>
# /Load Me Quickly

' . $rules;
            }
        }
        return $rules;
    }
开发者ID:vdulac,项目名称:load-me-quickly,代码行数:29,代码来源:class-load-me-quickly-htaccess.php

示例12: languages_list_header

 function languages_list_header()
 {
     if (function_exists('icl_get_languages')) {
         $languages = icl_get_languages('skip_missing=0&orderby=code');
         if (!empty($languages)) {
             echo '<div class="language"><ul>';
             echo '<li>' . __('Language: ', 'sptheme') . '</li>';
             foreach ($languages as $l) {
                 echo '<li class="' . $l['language_code'] . '">';
                 if (!$l['active']) {
                     echo '<a href="' . $l['url'] . '" title="' . $l['native_name'] . '">';
                 }
                 echo '<img src="' . $l['country_flag_url'] . '" alt="' . $l['native_name'] . '" />';
                 if (!$l['active']) {
                     echo '</a>';
                 }
                 echo '</li>';
             }
             echo '</ul></div>';
         }
     } else {
         return null;
         // Activate WMPL plugin
     }
 }
开发者ID:sovanda,项目名称:novafamily,代码行数:25,代码来源:functions-wpml.php

示例13: ww_widget_dropdown

    /**
     * Widget dropdown.
     *
     * Add a dropdown to every widget.
     */
    public function ww_widget_dropdown($widget, $form, $instance)
    {
        $languages = icl_get_languages();
        ?>
<p><label for='wpml_language'><?php 
        _e('Display on language:', 'wpml-widgets');
        ?>
 </label>
		<select id='wpml_language' name='wpml_language'><?php 
        foreach ($languages as $language) {
            $selected = $language['language_code'] == $instance['wpml_language'] ? 'SELECTED' : null;
            ?>
<option <?php 
            echo $selected;
            ?>
 value='<?php 
            echo $language['language_code'];
            ?>
'><?php 
            echo $language['native_name'];
            ?>
</option><?php 
        }
        $selected = 'all' == $instance['wpml_language'] || !isset($instance['wpml_language']) ? 'SELECTED' : null;
        ?>
			<option <?php 
        echo $selected;
        ?>
 value='all'><?php 
        _e('All Languages', 'wpml-widgets');
        ?>
</option>
		</select></p>
		<?php 
    }
开发者ID:adenilsonpaiva,项目名称:redelivre,代码行数:40,代码来源:wpml-widgets.php

示例14: language_switcher

 /**
  * WPML
  *
  * @since   1.0.0
  */
 function language_switcher()
 {
     $languages = icl_get_languages('skip_missing=0&orderby=id');
     if (is_array($languages) && !empty($languages)) {
         $html = '<div class="wpml-language-switcher">';
         foreach ($languages as $lang) {
             if ($lang['active']) {
                 $html .= '<div class="actived-language">';
                 $html .= '<a href="' . $lang['url'] . '">';
                 $html .= '<span class="language-flag"><img title="' . $lang['native_name'] . '" src="' . $lang['country_flag_url'] . '" /></span>';
                 //$html .= '<span class="language-native">'.$lang['native_name'].'</span>';
                 $html .= '<span class="language-translated">' . $lang['translated_name'] . '</span>';
                 $html .= '</a>';
                 $html .= '</div>';
             }
         }
         $html .= '<ul class="wpml-language-list">';
         foreach ($languages as $lang) {
             if (!$lang['active']) {
                 $html .= '<li class="language-' . $lang['language_code'] . '">';
                 $html .= '<a href="' . $lang['url'] . '">';
                 $html .= '<span class="language-flag"><img title="' . $lang['native_name'] . '" src="' . $lang['country_flag_url'] . '" /></span>';
                 //$html .= '<span class="language-native">'.$lang['native_name'].'</span>';
                 $html .= '<span class="language-translated">' . $lang['translated_name'] . '</span>';
                 $html .= '</a>';
                 $html .= '</li>';
             }
         }
         $html .= '</ul>';
         $html .= '</div>';
         return $html;
     }
 }
开发者ID:sniezekjp,项目名称:prod-fs,代码行数:38,代码来源:wpml-generator.php

示例15: wpsp_languageswitcherer

 function wpsp_languageswitcherer()
 {
     if (function_exists('icl_get_languages')) {
         $languages = icl_get_languages('skip_missing=1');
         if (1 < count($languages)) {
             echo '<nav class="language col-sm-4"><ul>';
             //echo '<li>' . __('Language: ', 'sptheme') . '</li>';
             foreach ($languages as $l) {
                 echo '<li class="' . $l['language_code'] . '">';
                 if (!$l['active']) {
                     echo '<a href="' . $l['url'] . '" title="' . $l['native_name'] . '">';
                 }
                 echo '<img src="' . $l['country_flag_url'] . '" alt="' . $l['native_name'] . '" />';
                 if (!$l['active']) {
                     echo '</a>';
                 }
                 echo '</li>';
             }
             echo '</ul></nav>';
         }
     } else {
         return null;
         // Activate WMPL plugin
     }
 }
开发者ID:sptheme,项目名称:discover-travel,代码行数:25,代码来源:theme-functions.php


注:本文中的icl_get_languages函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。