[wp-trac] [WordPress Trac] #10427: The 'recent comments' widget needs to flush its cache on transition_comment_status events
WordPress Trac
wp-trac at lists.automattic.com
Thu Jul 16 20:29:21 UTC 2009
#10427: The 'recent comments' widget needs to flush its cache on
transition_comment_status events
--------------------------+-------------------------------------------------
Reporter: josephscott | Owner: azaozz
Type: defect (bug) | Status: new
Priority: normal | Milestone: 2.9
Component: Widgets | Version: 2.8.1
Severity: normal | Keywords: has-patch
--------------------------+-------------------------------------------------
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.
--
Ticket URL: <http://core.trac.wordpress.org/ticket/10427>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list