本文整理汇总了PHP中ICanLocalizeQuery::cms_do_download方法的典型用法代码示例。如果您正苦于以下问题:PHP ICanLocalizeQuery::cms_do_download方法的具体用法?PHP ICanLocalizeQuery::cms_do_download怎么用?PHP ICanLocalizeQuery::cms_do_download使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ICanLocalizeQuery
的用法示例。
在下文中一共展示了ICanLocalizeQuery::cms_do_download方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: ICanLocalizeQuery
function process_translated_string($request_id, $language)
{
global $sitepress_settings, $wpdb, $sitepress;
$ret = false;
$iclq = new ICanLocalizeQuery($sitepress_settings['site_id'], $sitepress_settings['access_key']);
$translation = $iclq->cms_do_download($request_id, $language);
if ($translation) {
$ret = icl_translation_add_string_translation($request_id, $translation, $sitepress->get_language_code($this->server_languages_map($language, true)));
if ($ret) {
$iclq->cms_update_request_status($request_id, CMS_TARGET_LANGUAGE_DONE, $language);
}
}
// if there aren't any other unfullfilled requests send a global 'done'
if (0 == $wpdb->get_var("SELECT COUNT(rid) FROM {$wpdb->prefix}icl_core_status WHERE rid='{$request_id}' AND status < " . CMS_TARGET_LANGUAGE_DONE)) {
$iclq->cms_update_request_status($request_id, CMS_REQUEST_DONE, false);
}
return $ret;
}