本文整理匯總了PHP中ICanLocalizeQuery::cms_requests_all方法的典型用法代碼示例。如果您正苦於以下問題:PHP ICanLocalizeQuery::cms_requests_all方法的具體用法?PHP ICanLocalizeQuery::cms_requests_all怎麽用?PHP ICanLocalizeQuery::cms_requests_all使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類ICanLocalizeQuery
的用法示例。
在下文中一共展示了ICanLocalizeQuery::cms_requests_all方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: unset
unset($_POST['icl_trid']);
$item_updated = true;
}
}
if ($item_updated) {
$updated_items++;
}
if ($updated_items >= 20) {
break;
}
}
echo json_encode(array('updated' => $updated_items));
exit;
case 'sync_cancelled':
$iclq = new ICanLocalizeQuery($sitepress_settings['site_id'], $sitepress_settings['access_key']);
$requests = $iclq->cms_requests_all();
if ($requests === false) {
echo json_encode(array('errors' => 1, 'message' => 'Failed fetching jobs list from the server.'));
exit;
}
$cms_ids = array();
if (!empty($requests)) {
foreach ($requests as $request) {
$cms_ids[] = $request['cms_id'];
}
}
// get jobs that are in progress
$translations = $wpdb->get_results("\n SELECT t.element_id, t.element_type, t.language_code, t.source_language_code, t.trid, \n s.rid, s._prevstate, s.translation_id \n FROM {$wpdb->prefix}icl_translation_status s \n JOIN {$wpdb->prefix}icl_translations t\n ON t.translation_id = s.translation_id \n WHERE s.translation_service='icanlocalize'\n AND s.status = " . ICL_TM_IN_PROGRESS . "\n ");
$job2delete = $rids2cancel = array();
foreach ($translations as $t) {
$original_id = $wpdb->get_var($wpdb->prepare("SELECT element_id FROM {$wpdb->prefix}icl_translations\n WHERE trid=%d AND source_language_code IS NULL", $t->trid));