[wp-trac] [WordPress Trac] #8864: add the old comment's status in the action function arguments of wp_set_comment_status

WordPress Trac wp-trac at lists.automattic.com
Thu Jan 15 02:19:11 GMT 2009


#8864: add the old comment's status in the action function arguments of
wp_set_comment_status
-------------------------+--------------------------------------------------
 Reporter:  Jehan        |       Owner:  anonymous
     Type:  enhancement  |      Status:  new      
 Priority:  normal       |   Milestone:  2.8      
Component:  General      |     Version:           
 Severity:  normal       |    Keywords:           
-------------------------+--------------------------------------------------
 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.
 Thanks.

-- 
Ticket URL: <http://trac.wordpress.org/ticket/8864>
WordPress Trac <http://trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list