add the old comment's status in the action function arguments of wp_set_comment_status
|Reported by:||Jehan||Owned by:|
According to the doc, the action function arguments for wp_set_comment_status (which is not working right now: cf bug #8863) are the comment ID and the status string indicating the new status ("delete", "approve", "spam", "hold").
I think it would be nice to add an optional third argument: the status string indicating the former status (same: "delete", "approve", "spam", "hold") because when a comment's status change, sometimes one may be only interested by the current status; but other times, you may also be interested by the full change: from which to which status?
In a plugin I write for instance, I am publishing comments on a PubSub XMPP node, but only when approved. So if a comment goes to "spam", I will remove it from the node. But if it is changed from "hold" to "spam" for instance, it was anyway not published, so I send a delete query on an absent node (or else I must keep memory on the old status, but this is pretty unefficient).
This is not a serious drawback, but still it may avoid useless XMPP queries and I guess other people may think it to be interested by such third argument.