当前位置: 首页>>代码示例>>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;未经允许,请勿转载。