|Reported by:||mattoperry||Owned by:|
|Cc:||ocean90, nacin, info@…, bk@…|
This ticket provides a simple patch for comment history in core.
In at least a few places: (ticket:9117:10, ticket:15534:4, ticket:9495:3) Nacin has mused about the desirability of introducing comment history to core, citing Akismet’s implementation as a model for how this might be done.
There are good reasons for wanting this, as comment history could serve as a solid underpinning for a variety of other features such as more informative moderation emails, some indication of why a message was marked as spam, and even comment versioning.
The idea is that to implement any of that, we really should have basic comment versioning in core, a la Akisment.
Our goal was to expand the API so as to reproduce and streamline the basic history functionality provided by Akismet, port and tweak Akismet’s nice history UI, and keep the change set minimal.
Comment history API:
- added simple functions to /wp-includes/comment.php to get and update comment history. These in turn use existing comment_meta functions.
- there’s now a comment history meta box on the comment edit screen. It looks just like Akismet’s. This was implemented as a real meta box. A sorting function is also included.
- this patch supports the following history events, each of which has a nice, plain-english (internationalizable) history message, which always includes the user responsible for the action and a timesince.
- edit_comment (“edited by user”)
- trashed_comment (“trashed by user”)
- untrashed_comment (“un-trashed by user”)
- comment_unapproved_to_approved (“user approved this comment”)
- comment_approved_to_unapproved (“user unapproved this comment”)
- spammed_comment (“user marked this comment as spam”)
- unspammed_comment (“user marked this comment as ham”)
Here’s what we’d think of doing next if this were to be introduced into core:
- support more history events and provide more detail. In particular, support events where the comment is spammed as a result of a blacklist word or other reason.
- include some of this detail in moderation emails
- the Akismet plugin should be updated to use this new API instead of its own history functions
- meta boxes on edit comment did not work properly until this: http://core.trac.wordpress.org/ticket/21499 (in 3.5)
Who we are: