Make it possible to reply (or create a discussion) with another post type than `comment`
Changes proposed in this pull request:
Nothing breaking, just added the possibility to handle a type attribute coming from an API call to either create a discussion or reply to one. When the type attribute is provided, the according post model is used to create the post. This makes it possible to start a discussion with a post that is not of type comment.
Obviously the custom type need to be registered using the Post extender and the reply() method needs to be implemented with the same parameters as for the reply() method of the CommentPost model.
When no type is found, the post will be considered as a comment by default.
Reviewers should focus on: Nothing is broken, the new ability to create a post with a custom type works as expected.
Necessity
- [x] Has the problem that is being solved here been clearly explained?
- [x] If applicable, have various options for solving this problem been considered?
- [x] For core PRs, does this need to be in core, or could it be in an extension?
- [x] Are we willing to maintain this for years / potentially forever?
Confirmed
- [ ] Backend changes: tests are green (run
composer test). - [ ] Core developer confirmed locally this works as intended.
- [ ] Tests have been added, or are not appropriate here.