Fix buggy auto-purge comment routines #237
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
edit_comment
anddelete_comment
action hooks fromauto_purge_comment_post_cache()
; these are now handled by the newtransition_comment_status
hook that is attached to the newauto_purge_comment_transition()
routine.auto_purge_comment_transition()
routine; this newroutine properly handles the transition from one comment status to
another and only calls the purge routine when necessary.
static::$static['allow_purging']
variable tracks when acomment status change should not trigger a clear of the post cache
and ensures that a subsequent call to
auto_purge_post_cache()
doesnot cause the post cache to be cleared. This is necessary because, for
example, a spam comment will eventually trigger the
clear_post_cache
hook, which attaches directly to
auto_purge_post_cache()
and wouldresult in the post cache being cleared even when the comment cache
does not get cleared.
See #159
@jaswsinc Code review please, when you get a chance?