/** * delete all posts, media, files, and whatever value was in the 'Unique ID' field */ public function delete_and_edit() { $get = $this->input->get(array('id' => '')); if (!empty($get['id'])) { $import = new PMXI_Import_Record(); $import->getById($get['id']); if (!$import->isEmpty()) { $import->deletePosts(false); $options = $import->options; $options['unique_key'] = ''; $import->set(array('options' => $options, 'imported' => 0, 'created' => 0, 'updated' => 0, 'skipped' => 0, 'deleted' => 0))->save(); } } wp_redirect(add_query_arg(array('id' => $import->id, 'action' => 'options'), $this->baseUrl)); die; }