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