當前位置: 首頁>>代碼示例>>PHP>>正文


PHP ICanLocalizeQuery::cms_requests_all方法代碼示例

本文整理匯總了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));
開發者ID:GaryJones,項目名稱:TPWP,代碼行數:31,代碼來源:troubleshooting.php


注:本文中的ICanLocalizeQuery::cms_requests_all方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。