[wp-trac] Re: [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 19:15:24 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:  closed   
 Priority:  normal       |    Milestone:  2.8      
Component:  General      |      Version:           
 Severity:  normal       |   Resolution:  fixed    
 Keywords:               |  
-------------------------+--------------------------------------------------
Changes (by Jehan):

  * status:  new => closed
  * resolution:  => fixed

Comment:

 Ok, in fact it was already existing, though undocumented. It is the action
 "transition_comment_status", which can take up to 3 arguments: the new
 status, then the old status and finally the comment itself. This last
 argument is object comment, and not the comment id, at the opposite to
 wp_set_comment_status. That's not a real issue (as it is easy to pass from
 one to another), but still it is not very consistent from an action to
 another (the naming also are not always so consistent. Why sometimes begin
 with "wp_" and sometimes not?) and I think it is better to pass a simple
 integer as arguments (that you can use then to get the full comment data,
 if ever needed) than a full object.

 So I think this can be considered as fixed. If I don't forget, I will
 update the doc as well.

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


More information about the wp-trac mailing list