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


PHP qtranxf_get_language_blocks函数代码示例

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


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

示例1: dsq_qtrans_get_blocks

function dsq_qtrans_get_blocks($s)
{
    if (function_exists('qtranxf_get_language_blocks')) {
        return qtranxf_get_language_blocks($text);
    } else {
        return qtrans_get_language_blocks($text);
    }
}
开发者ID:grishka,项目名称:wp-disqus-qtranslate,代码行数:8,代码来源:disqus-qtranslate.php

示例2: qtranxf_trim_words

 function qtranxf_trim_words($text, $num_words, $more, $original_text)
 {
     global $q_config;
     $blocks = qtranxf_get_language_blocks($original_text);
     if (count($blocks) <= 1) {
         return $text;
     }
     $lang = $q_config['language'];
     $text = qtranxf_use_block($lang, $blocks, true, false);
     return wp_trim_words($text, $num_words, $more);
 }
开发者ID:AndreyLanko,项目名称:perevorot-prozorro-wp,代码行数:11,代码来源:qtranslate_frontend.php

示例3: qtranxf_getAvailableLanguages

function qtranxf_getAvailableLanguages($text)
{
    global $q_config;
    $blocks = qtranxf_get_language_blocks($text);
    if (count($blocks) <= 1) {
        return FALSE;
    }
    // no languages set
    $result = array();
    $content = qtranxf_split_languages($blocks);
    foreach ($content as $language => $lang_text) {
        $lang_text = trim($lang_text);
        if (!empty($lang_text)) {
            $result[] = $language;
        }
    }
    if (sizeof($result) == 0) {
        // add default language to keep default URL
        $result[] = $q_config['language'];
    }
    return $result;
}
开发者ID:antigenius,项目名称:qtranslate-x,代码行数:22,代码来源:qtranslate_utils.php

示例4: qtranxf_use_language

/** when $text is already known to be string */
function qtranxf_use_language($lang, $text, $show_available = false, $show_empty = false)
{
    $blocks = qtranxf_get_language_blocks($text);
    if (count($blocks) <= 1) {
        //no language is encoded in the $text, the most frequent case
        return $text;
    }
    return qtranxf_use_block($lang, $blocks, $show_available, $show_empty);
}
开发者ID:raxdev,项目名称:qtranslate-x,代码行数:10,代码来源:qtranslate_core.php

示例5: qtranxf_trim_words

function qtranxf_trim_words($text, $num_words, $more, $original_text)
{
    global $q_config;
    //qtranxf_dbg_log('qtranxf_trim_words: $text: ',$text);
    //qtranxf_dbg_log('qtranxf_trim_words: $original_text: ',$original_text);
    $blocks = qtranxf_get_language_blocks($original_text);
    //qtranxf_dbg_log('qtranxf_trim_words: $blocks: ',$blocks);
    if (count($blocks) <= 1) {
        return $text;
    }
    $lang = $q_config['language'];
    $texts = qtranxf_split_blocks($blocks);
    foreach ($texts as $key => $txt) {
        $texts[$key] = wp_trim_words($txt, $num_words, $more);
    }
    return qtranxf_join_b($texts);
    //has to be 'b', because 'c' gets stripped in /wp-admin/includes/nav-menu.php:182: esc_html( $item->description )
}
开发者ID:ycms,项目名称:framework,代码行数:18,代码来源:qtx_admin_utils.php


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