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