The 'recent comments' widget needs to flush its cache on transition_comment_status events
|Reported by:||josephscott||Owned by:||azaozz|
The WP iPhone app uses the wp.editComment XML-RPC method to change the status of a comment. This uses the core wp_update_comment() function to do the actual updates to a comment. Which in turn calls the wp_transition_comment_status() function to trigger hooks that are watching for comment status changes.
Currently the recent comment widget only clears the cache on comment_post and wp_set_comment_status events. So comments that get their status changed through wp_update_comment() don't cause the recent comments widget cache to get updated. To solve this here is my one line patch that adds transition_comment_status to the list of actions that cause the recent comments widget cache to get updated.
As a side note, I think that we could remove the wp_set_comment_status action from the flush cache list for this widget. That event should get caught by the transition_comment_status action as well. I didn't not verify that this was case though, so I did not remove that line in my patch.