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


PHP TranslationManagement::get_translation_job方法代碼示例

本文整理匯總了PHP中TranslationManagement::get_translation_job方法的典型用法代碼示例。如果您正苦於以下問題:PHP TranslationManagement::get_translation_job方法的具體用法?PHP TranslationManagement::get_translation_job怎麽用?PHP TranslationManagement::get_translation_job使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在TranslationManagement的用法示例。


在下文中一共展示了TranslationManagement::get_translation_job方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: init_job

 private function init_job()
 {
     $this->job = false;
     $this->translator_has_job_language_pairs = false;
     $this->user_can_take_this_job = false;
     $this->job_id = WPML_Translation_Editor::get_job_id_from_request();
     if ($this->job_id) {
         WPML_Translation_Job_Terms::set_translated_term_values($this->job_id);
         $this->job = $this->sitepressTM->get_translation_job($this->job_id, false, true, 1);
         if ($this->job) {
             $this->user_can_take_this_job = $this->job->translator_id == 0 || $this->job->translator_id == $this->current_user->ID;
             $this->job_language_pairs = array('lang_from' => $this->job->source_language_code, 'lang_to' => $this->job->language_code);
             $this->translator_has_job_language_pairs = $this->sitepressTM->is_translator($this->current_user->ID, $this->job_language_pairs);
         }
     }
     $this->is_valid_job = !$this->job || (!$this->user_can_take_this_job || !$this->translator_has_job_language_pairs) && !current_user_can('manage_options');
 }
開發者ID:ryuqing,項目名稱:cake,代碼行數:17,代碼來源:translation-editor.php


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