本文整理汇总了PHP中TranslationManagement::get_translator_edit_url方法的典型用法代码示例。如果您正苦于以下问题:PHP TranslationManagement::get_translator_edit_url方法的具体用法?PHP TranslationManagement::get_translator_edit_url怎么用?PHP TranslationManagement::get_translator_edit_url使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TranslationManagement
的用法示例。
在下文中一共展示了TranslationManagement::get_translator_edit_url方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: ajax_calls
function ajax_calls($call, $data)
{
global $wpdb, $sitepress;
switch ($call) {
case 'assign_translator':
$translator_data = TranslationProxy_Service::get_translator_data_from_wpml($data['translator_id']);
$service_id = $translator_data['translation_service'];
$translator_id = $translator_data['translator_id'];
$assign_translation_job = $this->assign_translation_job($data['job_id'], $translator_id, $service_id, $data['job_type']);
if ($assign_translation_job) {
$translator_edit_link = '';
if ($translator_id) {
if ($service_id == TranslationProxy::get_current_service_id()) {
$job = $this->get_translation_job($data['job_id']);
/** @var $ICL_Pro_Translation WPML_Pro_Translation */
global $ICL_Pro_Translation;
$ICL_Pro_Translation->send_post($job->original_doc_id, array($job->language_code), $translator_id, $data['job_id']);
$project = TranslationProxy::get_current_project();
$translator_edit_link = TranslationProxy_Popup::get_link($project->translator_contact_iframe_url($translator_id), array('title' => __('Contact the translator', 'sitepress'), 'unload_cb' => 'icl_thickbox_refresh')) . esc_html(TranslationProxy_Translator::get_translator_name($translator_id)) . "</a> ({$project->service}->name)";
} else {
$translator_edit_link = '<a href="' . TranslationManagement::get_translator_edit_url($data['translator_id']) . '">' . esc_html($wpdb->get_var($wpdb->prepare("SELECT display_name FROM {$wpdb->users} WHERE ID=%d", $data['translator_id']))) . '</a>';
}
}
echo wp_json_encode(array('error' => 0, 'message' => $translator_edit_link, 'status' => TranslationManagement::status2text(ICL_TM_WAITING_FOR_TRANSLATOR), 'service' => $service_id));
} else {
echo wp_json_encode(array('error' => 1));
}
break;
case 'icl_cf_translation':
case 'icl_tcf_translation':
if (!empty($data['cf'])) {
foreach ($data['cf'] as $k => $v) {
$cft[base64_decode($k)] = $v;
}
if (isset($cft)) {
$this->settings[$call === 'icl_tcf_translation' ? WPML_TERM_META_SETTING_INDEX_PLURAL : WPML_POST_META_SETTING_INDEX_PLURAL] = $cft;
$this->save_settings();
}
}
echo '1|';
break;
case 'icl_doc_translation_method':
$this->settings['doc_translation_method'] = intval($data['t_method']);
$sitepress->set_setting('doc_translation_method', $this->settings['doc_translation_method']);
$sitepress->save_settings(array('hide_how_to_translate' => empty($data['how_to_translate'])));
if (isset($data['tm_block_retranslating_terms'])) {
$sitepress->set_setting('tm_block_retranslating_terms', $data['tm_block_retranslating_terms']);
} else {
$sitepress->set_setting('tm_block_retranslating_terms', '');
}
if (isset($data['tm_block_retranslating_terms'])) {
$sitepress->set_setting('tm_block_retranslating_terms', $data['tm_block_retranslating_terms']);
} else {
$sitepress->set_setting('tm_block_retranslating_terms', '');
}
$this->save_settings();
echo '1|';
break;
case 'reset_duplication':
$this->reset_duplicate_flag($_POST['post_id']);
break;
case 'set_duplication':
$new_id = $this->set_duplicate($_POST['wpml_original_post_id'], $_POST['post_lang']);
wp_send_json_success(array('id' => $new_id));
break;
case 'make_duplicates':
$mdata['iclpost'] = array($data['post_id']);
$langs = explode(',', $data['langs']);
foreach ($langs as $lang) {
$mdata['duplicate_to'][$lang] = 1;
}
$this->make_duplicates($mdata);
do_action('wpml_new_duplicated_terms', (array) $mdata['iclpost'], false);
break;
}
}