本文整理匯總了PHP中ICanLocalizeQuery::cms_update_request_status方法的典型用法代碼示例。如果您正苦於以下問題:PHP ICanLocalizeQuery::cms_update_request_status方法的具體用法?PHP ICanLocalizeQuery::cms_update_request_status怎麽用?PHP ICanLocalizeQuery::cms_update_request_status使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類ICanLocalizeQuery
的用法示例。
在下文中一共展示了ICanLocalizeQuery::cms_update_request_status方法的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;
}