private function updateTaxonomy($data) { $taxonomy = Taxonomy::find((int) $_POST['id']); $new_parent_id = (int) $data['taxonomy']['content-type-id']; if (!$new_parent_id) { $taxonomy->parent_id = null; } else { $taxonomy->parent_id = $new_parent_id; } try { $saved = $taxonomy->save(); $this->content_types_admin_index(); } catch (Exception $e) { return new WP_Error(500, "Could not update taxonomy"); } return $saved; }