0) { $deleted = (new \Plugi\Extensions\Blog\CategoriesRepository())->destroy((int) $_POST['id']); } } catch (\Throwable) { $deleted = false; } phpb_redirect(phpb_url('website_manager', ['tab' => 'ext--blog', 'action' => 'categories']), [ 'message-type' => $deleted ? 'success' : 'error', 'message' => $deleted ? 'Category deleted; associated posts are uncategorized.' : 'The category could not be deleted.', ]);