The cleanest way is to use the models methods: DiscussionModel::instance()->deleteID will do the trick
/**
* Delete a discussion. Update and/or delete all related data.
*
* Events: DeleteDiscussion.
*
* @param int $discussionID Unique ID of discussion to delete.
* @param array $options Additional options to control the delete behavior. Not used for discussions.
* @return bool Always returns **true**.
*/
public function deleteID($discussionID, $options = []) {
Maybe you would like to use the Vanilla Forums API, in Python you would request a http DELETE using requests to `https://[yousite.com]/api/v2/discussions/[discussion_id]`
I think (obviously) you will need the authorizations for the request to be accepted, I never tinkered with the api yet, but I think you can manage to do it with this example (or translate it to whichever language you use)
Comments
Hi @rloyola
You will need a custom plugin for that.
I am not sure maybe the “Archive” function still exists in Vanilla. But I guess that is not what you want to achieve.
The cleanest way is to use the models methods:
DiscussionModel::instance()->deleteID
will do the trickMaybe you would like to use the Vanilla Forums API, in Python you would request a http
DELETE
using requests to `https://[yousite.com]/api/v2/discussions/[discussion_id]`I think (obviously) you will need the authorizations for the request to be accepted, I never tinkered with the api yet, but I think you can manage to do it with this example (or translate it to whichever language you use)
Also, for security reasons maybe you would like to configure your webserver to restrict requests only for you specific IP address.