• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP wpml_home_url_ls_hide_check函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: widget

 /**
  * Outputs the content of the widget
  *
  * @param array $args
  * @param array $instance
  */
 public function widget($args, $instance)
 {
     if (function_exists('wpml_home_url_ls_hide_check') && wpml_home_url_ls_hide_check()) {
         return;
     }
     language_selector_widget($args);
 }
开发者ID:edgarter,项目名称:wecare,代码行数:13,代码来源:icl-language-switcher.class.php


示例2: toolset_starter_lang_switcher

/** Hook function */
function toolset_starter_lang_switcher($items, $args)
{
    $multilingual = false;
    $languages = '';
    //Check if we are on multilingual mode
    $languages = apply_filters('wpml_active_languages', NULL, array('skip_missing' => 0));
    if (!empty($languages) && is_array($languages)) {
        //multilingual
        global $sitepress_settings;
        $multilingual = true;
    }
    //Let's retrieved languages
    if ($multilingual) {
        if (empty($languages)) {
            //We have empty languages.
            //Test for backward compatibility with older WPML versions where active languages API is not yet defined
            if (function_exists('icl_get_languages')) {
                $languages = icl_get_languages('skip_missing=0');
            }
        }
        //Languages set, implies WPML is active
        global $is_lang_selector_dropdown;
        if (!empty($sitepress_settings['display_ls_in_menu']) && (!function_exists('wpml_home_url_ls_hide_check') || !wpml_home_url_ls_hide_check()) && $is_lang_selector_dropdown) {
            /** We want to display our customized lang switcher ONLY if
               	/*  WPML -> Languages -> Language switcher options -> Language switcher in the WP Menu -> Display the language switcher in the WP Menu is checked
                */
            /** TOOLSET STARTER 1.3.4: Add the customized lang switcher to the correct menu set in 'Display the language switcher in the WP Menu' */
            /** START */
            //Get the menu for WPML language switcher
            $menu_match = false;
            if (isset($sitepress_settings['menu_for_ls'])) {
                $menu_for_ls = $sitepress_settings['menu_for_ls'];
                $menu_for_ls = intval($menu_for_ls);
                if ($menu_for_ls > 0) {
                    //menu defined, get the menu slug corresponding this ID
                    $menu_details = get_term($menu_for_ls, 'nav_menu');
                    $menu_for_ls_slug_setting = $menu_details->slug;
                    if (isset($args->menu->slug)) {
                        $menu_slug_under_process = $args->menu->slug;
                        if ($menu_slug_under_process == $menu_for_ls_slug_setting) {
                            $menu_match = true;
                        }
                    }
                }
            }
            /** END */
            if (1 < count($languages) && $menu_match) {
                $ll_flag = $languages[ICL_LANGUAGE_CODE]['country_flag_url'];
                $ll_url = $languages[ICL_LANGUAGE_CODE]['url'];
                $ll_code = $languages[ICL_LANGUAGE_CODE]['language_code'];
                $ll_nname = $languages[ICL_LANGUAGE_CODE]['native_name'];
                $ll_tname = $languages[ICL_LANGUAGE_CODE]['translated_name'];
                //Flag content
                //Check if flags are enabled
                $flags_enabled = false;
                if (isset($sitepress_settings['icl_lso_flags'])) {
                    $flag_setting = $sitepress_settings['icl_lso_flags'];
                    if ($flag_setting) {
                        $flags_enabled = true;
                    }
                }
                //Language name in display language
                $lang_name_disp_language_enabled = false;
                if (isset($sitepress_settings['icl_lso_display_lang'])) {
                    $icl_lso_display_lang_setting = $sitepress_settings['icl_lso_display_lang'];
                    if ($icl_lso_display_lang_setting) {
                        $lang_name_disp_language_enabled = true;
                    }
                }
                //Native language name
                $native_lang_name_enabled = false;
                if (isset($sitepress_settings['icl_lso_native_lang'])) {
                    $icl_lso_native_lang_setting = $sitepress_settings['icl_lso_native_lang'];
                    if ($icl_lso_native_lang_setting) {
                        $native_lang_name_enabled = true;
                    }
                }
                $flag_content_main = '';
                if ($flags_enabled) {
                    $flag_content_main = '<img src="' . $ll_flag . '" height="12" alt="' . $ll_code . '" width="18" />';
                }
                $native_lang_main = '';
                if ($native_lang_name_enabled) {
                    $native_lang_main = $ll_nname;
                }
                $show_parenthesis = true;
                if (!$native_lang_name_enabled) {
                    //Native lang off, don't show parenthesis
                    $show_parenthesis = false;
                }
                $open_parenthesis = '';
                $close_parenthesis = '';
                if ($show_parenthesis) {
                    $open_parenthesis = '(';
                    $close_parenthesis = ')';
                }
                $lang_name_display_lang_main = '';
                if ($lang_name_disp_language_enabled) {
                    $lang_name_display_lang_main = $open_parenthesis . $ll_tname . $close_parenthesis;
//.........这里部分代码省略.........
开发者ID:twelch555,项目名称:core_toolsetstarter,代码行数:101,代码来源:bootstrap-wordpress.php


示例3: get_language_selector_footer

    static function get_language_selector_footer()
    {
        global $sitepress;
        $language_selector_footer = '';
        $languages = array();
        if (!function_exists('wpml_home_url_ls_hide_check') || !wpml_home_url_ls_hide_check()) {
            $languages = $sitepress->footer_preview ? icl_get_languages() : $sitepress->get_ls_languages();
        }
        if (!empty($languages)) {
            $language_selector_footer = '
							<div id="lang_sel_footer">
									<ul>
									';
            foreach ($languages as $lang) {
                $alt_title_lang = $sitepress->get_setting('icl_lso_display_lang') ? esc_attr($lang['translated_name']) : esc_attr($lang['native_name']);
                $language_selector_footer .= '    <li>';
                $language_selector_footer .= '<a href="' . apply_filters('WPML_filter_link', $lang['url'], $lang) . '"';
                if ($lang['active']) {
                    $language_selector_footer .= ' class="lang_sel_sel"';
                }
                $language_selector_footer .= '>';
                if ($sitepress->get_setting('icl_lso_flags') || $sitepress->footer_preview) {
                    $language_selector_footer .= '<img src="' . $lang['country_flag_url'] . '" alt="' . $alt_title_lang . '" class="iclflag" title="' . $alt_title_lang . '" ';
                }
                if (!$sitepress->get_setting('icl_lso_flags') && $sitepress->footer_preview) {
                    $language_selector_footer .= ' style="display:none;"';
                }
                if ($sitepress->get_setting('icl_lso_flags') || $sitepress->footer_preview) {
                    $language_selector_footer .= ' />&nbsp;';
                }
                if ($sitepress->footer_preview) {
                    $lang_native = $lang['native_name'];
                    if ($sitepress->get_setting('icl_lso_native_lang')) {
                        $lang_native_hidden = false;
                    } else {
                        $lang_native_hidden = true;
                    }
                    $lang_translated = $lang['translated_name'];
                    if ($sitepress->get_setting('icl_lso_display_lang')) {
                        $lang_translated_hidden = false;
                    } else {
                        $lang_translated_hidden = true;
                    }
                } else {
                    if ($sitepress->get_setting('icl_lso_native_lang')) {
                        $lang_native = $lang['native_name'];
                    } else {
                        $lang_native = false;
                    }
                    if ($sitepress->get_setting('icl_lso_display_lang')) {
                        $lang_translated = $lang['translated_name'];
                    } else {
                        $lang_translated = false;
                    }
                    $lang_native_hidden = false;
                    $lang_translated_hidden = false;
                }
                $language_selector_footer .= icl_disp_language($lang_native, $lang_translated, $lang_native_hidden, $lang_translated_hidden);
                $language_selector_footer .= '</a>';
                $language_selector_footer .= '</li>
									';
            }
            $language_selector_footer .= '</ul>
							</div>';
        }
        return $language_selector_footer;
    }
开发者ID:Calraiser,项目名称:flux,代码行数:67,代码来源:language-switcher.php


示例4: get_language_selector

 function get_language_selector()
 {
     if (!function_exists('wpml_home_url_ls_hide_check') || !wpml_home_url_ls_hide_check()) {
         // Mobile or auto
         $type = $this->settings['icl_lang_sel_type'];
         $mobile = $this->settings['icl_lang_sel_stype'] === 'mobile' || ($type === 'mobile' || $type === 'mobile-auto' && (!empty($this->is_tablet) || !empty($this->is_mobile)));
         global $icl_language_switcher_preview;
         if (!$mobile && ($type === 'list' || $icl_language_switcher_preview)) {
             global $icl_language_switcher;
             $icl_language_switcher->widget_list();
         }
         return $mobile === true ? $this->get_mobile_language_selector() : (!$icl_language_switcher_preview && $type === 'list' ? '' : $this->get_desktop_language_selector());
     } else {
         return '';
     }
 }
开发者ID:phucanh92,项目名称:vietlong,代码行数:16,代码来源:sitepress.class.php


示例5:

<?php

/* 
 * DEPRECATED FILE!
 * 
 * please use $sitepress->get_desktop_language_selector() instead of including this file. 
 */
if (function_exists('wpml_home_url_ls_hide_check') && wpml_home_url_ls_hide_check()) {
    return;
}
global $w_this_lang;
if ($w_this_lang['code'] == 'all') {
    $main_language['native_name'] = __('All languages', 'sitepress');
}
if (empty($main_language)) {
    $main_language['native_name'] = $w_this_lang['display_name'];
    $main_language['translated_name'] = $w_this_lang['display_name'];
    $main_language['language_code'] = $w_this_lang['code'];
    if ($this->settings['icl_lso_flags'] || $icl_language_switcher_preview) {
        $flag = $this->get_flag($w_this_lang['code']);
        if ($flag->from_template) {
            $wp_upload_dir = wp_upload_dir();
            $main_language['country_flag_url'] = $wp_upload_dir['baseurl'] . '/flags/' . $flag->flag;
        } else {
            $main_language['country_flag_url'] = ICL_PLUGIN_URL . '/res/flags/' . $flag->flag;
        }
    }
}
?>
<div id="lang_sel"<?php 
if ($this->settings['icl_lang_sel_type'] == 'list') {
开发者ID:tlandn,项目名称:akvo-sites-zz-template,代码行数:31,代码来源:language-selector.php


示例6:

<?php

/* 
 * DEPRECATED FILE!
 * 
 * please use $sitepress->get_desktop_language_selector() instead of including this file. 
 */
global $sitepress;
if ($sitepress === null || function_exists('wpml_home_url_ls_hide_check') && wpml_home_url_ls_hide_check()) {
    return;
}
echo $sitepress->get_desktop_language_selector();
开发者ID:SayenkoDesign,项目名称:ividf,代码行数:12,代码来源:language-selector.php


示例7: language_selector_footer

 function language_selector_footer()
 {
     global $sitepress;
     if (function_exists('wpml_home_url_ls_hide_check') && wpml_home_url_ls_hide_check()) {
         return;
     }
     $languages = $this->footer_preview ? icl_get_languages() : $sitepress->get_ls_languages();
     if (!empty($languages)) {
         echo '
             <div id="lang_sel_footer">
                 <ul>
                 ';
         foreach ($languages as $lang) {
             $alt_title_lang = $this->settings['icl_lso_display_lang'] ? esc_attr($lang['translated_name']) : esc_attr($lang['native_name']);
             echo '    <li>';
             echo '<a href="' . apply_filters('WPML_filter_link', $lang['url'], $lang) . '"';
             if ($lang['active']) {
                 echo ' class="lang_sel_sel"';
             }
             echo '>';
             if ($this->settings['icl_lso_flags'] || $this->footer_preview) {
                 echo '<img src="' . $lang['country_flag_url'] . '" alt="' . $alt_title_lang . '" class="iclflag" title="' . $alt_title_lang . '" ';
             }
             if (!$this->settings['icl_lso_flags'] && $this->footer_preview) {
                 echo ' style="display:none;"';
             }
             if ($this->settings['icl_lso_flags'] || $this->footer_preview) {
                 echo ' />&nbsp;';
             }
             //if(!$l['active']) echo '</a>';
             //if(!$l['active']) echo '<a href="'.$l['url'].'">';
             if ($this->footer_preview) {
                 $lang_native = $lang['native_name'];
                 if ($this->settings['icl_lso_native_lang']) {
                     $lang_native_hidden = false;
                 } else {
                     $lang_native_hidden = true;
                 }
                 $lang_translated = $lang['translated_name'];
                 if ($this->settings['icl_lso_display_lang']) {
                     $lang_translated_hidden = false;
                 } else {
                     $lang_translated_hidden = true;
                 }
             } else {
                 if ($this->settings['icl_lso_native_lang']) {
                     $lang_native = $lang['native_name'];
                 } else {
                     $lang_native = false;
                 }
                 if ($this->settings['icl_lso_display_lang']) {
                     $lang_translated = $lang['translated_name'];
                 } else {
                     $lang_translated = false;
                 }
                 $lang_native_hidden = false;
                 $lang_translated_hidden = false;
             }
             echo icl_disp_language($lang_native, $lang_translated, $lang_native_hidden, $lang_translated_hidden);
             //echo icl_disp_language( $this->settings['icl_lso_native_lang'] ? $l['native_name'] : null, $this->settings['icl_lso_display_lang'] ? $l['translated_name'] : null );
             //if(!$l['active']) echo '</a>';
             echo '</a>';
             echo '</li>
                 ';
         }
         echo '</ul>
             </div>';
     }
 }
开发者ID:sedici,项目名称:wpmu-istec,代码行数:69,代码来源:language-switcher.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP wpml_is_ajax函数代码示例发布时间:2022-05-23
下一篇:
PHP wpml_get_setting_filter函数代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap