本文整理汇总了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);
}
}
示例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);
}
示例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;
}
示例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);
}
示例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 )
}