[wp-trac] [WordPress Trac] #8863: wp_set_comment_status action is not raised

WordPress Trac wp-trac at lists.automattic.com
Sat Aug 15 22:54:12 UTC 2009


#8863: wp_set_comment_status action is not raised
-----------------------------------------+----------------------------------
 Reporter:  Jehan                        |        Owner:  Jehan   
     Type:  defect (bug)                 |       Status:  reopened
 Priority:  normal                       |    Milestone:  2.8     
Component:  Comments                     |      Version:  2.7     
 Severity:  normal                       |   Resolution:          
 Keywords:  has-patch reporter-feedback  |  
-----------------------------------------+----------------------------------

Comment(by Captaffy):

 1. Create a post and publish it.

 2. While still logged in, leave two comments on the post. (Since you're
 still logged in, they will automatically be approved).

 3. Go to the Edit Comments screen (/wp-admin/edit-comments.php) and check
 the checkbox for the two new comments.

 4. In the Bulk Actions dropdown, select Unapprove and click Apply.

 5. The comments will be unapproved, but the transition_comment_status hook
 will not be fired for either of the comments.

 This is because the $new_status and $old_status values passed in to the
 wp_transition_comment_status() function (/wp-includes/comment.php line
 811) are both 'approved'. This causes the if-block at line 824 not to be
 entered and the hook not to be fired.

 A possible fix for this is to move the line '$comment =
 get_comment($comment_id);' in the wp_set_comment_status() function (/wp-
 includes/comment.php) at line 1066 to line 1055, before the comment status
 update is done.

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/8863#comment:13>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list