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