/**
  * Save active language in term metadata.
  *
  * @param $term_id
  * @param $tt_id
  * @param $taxonomy
  */
 function create_term($term_id, $tt_id, $taxonomy)
 {
     if ($this->is_public_tax_type($taxonomy) && (FW_Request::REQUEST('action') === 'add-tag' || FW_Request::REQUEST('action') === 'editpost' || FW_Request::REQUEST('action') === 'add-category')) {
         $translation_id = FW_Request::POST('fw_options/fw_translate_id', $term_id);
         $translation_lang = FW_Request::POST('fw_options/fw_translate_to', $this->get_parent()->get_admin_active_language());
         $translations = $this->query_translation($translation_id);
         $translation_exists = $this->translation_exists($translations, $translation_lang);
         if (!empty($translation_exists)) {
             $response = array('what' => 'taxonomy', 'action' => 'add-tag', 'id' => new WP_Error('translation_exists', __('The term translation does already exists.ACTION +++ ' . FW_Request::REQUEST('action'))));
             $xmlResponse = new WP_Ajax_Response($response);
             $xmlResponse->send();
         }
         fw_update_term_meta($term_id, 'translation_id', $translation_id);
         fw_update_term_meta($term_id, 'translation_lang', $translation_lang);
         if (!is_null(FW_Request::POST('fw_options/fw_second_translate_to'))) {
             fw_update_term_meta($translation_id, 'translation_id', $translation_id);
             fw_update_term_meta($translation_id, 'translation_lang', FW_Request::POST('fw_options/fw_second_translate_to'));
         }
     }
 }
 /**
  * @internal
  */
 public function _admin_action_admin_init()
 {
     $nonce = FW_Request::REQUEST('_wpnonce');
     // Auto-Install
     // Is a part of process of getting rid of update notifications after auto-install
     if (isset($_GET['auto-install-redirect'])) {
         wp_redirect($_GET['auto-install-redirect']);
     }
     // Auto Install (a process of restoring from **demo install** archive)
     if (wp_verify_nonce($nonce, 'backup-auto-install')) {
         $this->do_backup_auto_install();
     }
     // Feedback
     if ($post_id = $this->get_feedback_subject()) {
         if (!$this->backup()->get_feedback($post_id)) {
             wp_redirect($this->url_backup_page());
             exit;
         }
     }
     // Backup
     if (wp_verify_nonce($nonce, 'backup-now')) {
         $this->do_backup_now(FW_Request::GET('cron'));
     }
     if (wp_verify_nonce($nonce, 'backup-cancel')) {
         $this->do_backup_cancel(FW_Request::GET('post'));
     }
     if (wp_verify_nonce($nonce, 'backup-delete')) {
         $this->do_backup_delete(FW_Request::GET('post'));
     }
     if (wp_verify_nonce($nonce, 'backup-unschedule')) {
         $this->do_backup_unschedule(FW_Request::GET('cron'));
     }
     if (wp_verify_nonce($nonce, 'backup-download')) {
         $this->do_backup_download(FW_Request::GET('post'));
     }
     // Demo Install
     if (wp_verify_nonce($nonce, 'backup-demo-install')) {
         $this->do_backup_demo_install();
     }
     // Restore
     if ($this->is_backup_restore()) {
         $this->do_backup_restore(FW_Request::GET('post'));
     }
 }