本文整理匯總了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');
}