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


PHP qtranxf_use_language函数代码示例

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


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

示例1: qtranxf_get_attachment_image_attributes

function qtranxf_get_attachment_image_attributes($attr, $attachment = null, $size = null)
{
    global $q_config;
    $lang = $q_config['language'];
    //qtranxf_dbg_echo('qtranxf_get_attachment_image_attributes: $attachment:',$attachment);
    if (isset($attr['alt'])) {
        $attr['alt'] = qtranxf_use_language($lang, $attr['alt'], false, false);
    }
    //foreach( $attr as $name => $value ){
    //qtranxf_dbg_echo('qtranxf_get_attachment_image_attributes: $name='.$name.'; value='.$value);
    //if($name!=='alt') continue;
    //$attr[$name]=qtranxf_use_language($lang,$value,false,false);
    ////$attr[$name]=qtranxf_useCurrentLanguageIfNotFoundUseDefaultLanguage($value);
    //}
    return $attr;
}
开发者ID:AndreyLanko,项目名称:perevorot-prozorro-wp,代码行数:16,代码来源:qtranslate_frontend.php

示例2: qtranxf_use

function qtranxf_use($lang, $text, $show_available = false, $show_empty = false)
{
    //global $q_config;
    // return full string if language is not enabled
    //if(!qtranxf_isEnabled($lang)) return $text;//why?
    if (is_array($text)) {
        // handle arrays recursively
        foreach ($text as $key => $t) {
            $text[$key] = qtranxf_use($lang, $text[$key], $show_available, $show_empty);
        }
        return $text;
    }
    if (is_object($text) || $text instanceof __PHP_Incomplete_Class) {
        //since 3.2-b1 instead of @get_class($text) == '__PHP_Incomplete_Class'
        foreach (get_object_vars($text) as $key => $t) {
            $text->{$key} = qtranxf_use($lang, $text->{$key}, $show_available, $show_empty);
        }
        return $text;
    }
    // prevent filtering weird data types and save some resources
    if (!is_string($text) || empty($text)) {
        //|| $text) == ''
        return $text;
    }
    return qtranxf_use_language($lang, $text, $show_available, $show_empty);
}
开发者ID:raxdev,项目名称:qtranslate-x,代码行数:26,代码来源:qtranslate_core.php

示例3: qtranxf_filter_options_general

function qtranxf_filter_options_general($value)
{
    global $q_config;
    global $pagenow;
    switch ($pagenow) {
        case 'options-general.php':
        case 'customize.php':
            //there is more work to do for this case
            return $value;
        default:
            break;
    }
    $lang = $q_config['language'];
    return qtranxf_use_language($lang, $value, false, false);
}
开发者ID:ycms,项目名称:framework,代码行数:15,代码来源:qtx_admin_utils.php

示例4: qtranxf_translate_menu

/**
 * @since 3.3.8.7
 */
function qtranxf_translate_menu(&$m)
{
    global $q_config;
    $lang = $q_config['language'];
    foreach ($m as $k => &$item) {
        if (empty($item[0])) {
            continue;
        }
        $item[0] = qtranxf_use_language($lang, $item[0]);
    }
}
开发者ID:AndreyLanko,项目名称:perevorot-prozorro-wp,代码行数:14,代码来源:qtx_admin.php

示例5: qwpseo_get_post_metadata

function qwpseo_get_post_metadata($original_value, $object_id, $meta_key = '', $single = false)
{
    global $q_config;
    if (empty($meta_key)) {
        //very ugly hack
        $trace = debug_backtrace();
        //qtranxf_dbg_log('qwpseo_get_post_metadata: $trace: ',$trace);
        //qtranxf_dbg_log('qwpseo_get_post_metadata: $trace[6][args][0]: ',$trace[6]['args'][0]);
        //qtranxf_dbg_log('qwpseo_get_post_metadata: $trace[7][function]: ',$trace[7]['function']);
        if (isset($trace[7]['function']) && $trace[7]['function'] === 'calculate_results' && isset($trace[6]['args'][0]) && $trace[6]['args'][0] === 'focuskw') {
            //qtranxf_dbg_log('qwpseo_get_post_metadata: $object_id: ',$object_id);
            //qtranxf_dbg_log('qwpseo_get_post_metadata: $single: ',$single);
            $key = WPSEO_Meta::$meta_prefix . 'focuskw';
            $focuskw = get_metadata('post', $object_id, $key, true);
            //qtranxf_dbg_log('qwpseo_get_post_metadata: $focuskw: ',$focuskw);
            $focuskw = qtranxf_use_language($q_config['language'], $focuskw);
            return array($key => array($focuskw));
        }
    }
    return $original_value;
}
开发者ID:jesusmarket,项目名称:jesusmarket,代码行数:21,代码来源:qwpseo-admin.php

示例6: qwpseo_enable_xml_sitemap_post_url

/**
 * Translates $p->post_content to make image lookup work correctly later.
*/
function qwpseo_enable_xml_sitemap_post_url($loc, $p)
{
    global $q_config;
    $lang = $q_config['language'];
    //qtranxf_dbg_log('qwpseo_enable_xml_sitemap_post_url: $sm: ', $p);
    $p->post_content = qtranxf_use_language($lang, $p->post_content, false, true);
    return $loc;
}
开发者ID:jesusmarket,项目名称:jesusmarket,代码行数:11,代码来源:qwpseo-front.php


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