#10427 closed defect (bug) (fixed)
The 'recent comments' widget needs to flush its cache on transition_comment_status events
| Reported by: |
|
Owned by: |
|
|---|---|---|---|
| Priority: | normal | Milestone: | 2.9 |
| Component: | Widgets | Version: | 2.8.1 |
| Severity: | normal | Keywords: | has-patch |
| Cc: | joseph@… |
Description
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.

(In [11718]) Flush the cache in Recent Comments widget on transition_comment_status, props josephscott, fixes #10427