當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。