Page cache refresh on comments
-
First of all, thanks for including the “Custom Refresh Rules”, works flawlessly.
It seems the action hook transition_comment_status only fires up for Approve, Unapprove, Spam and Trash but doesn’t account for newly added comments and edited comments. I got mine working by copying Gator-Cache’s saveComment function and adding it on comment_post and comment_edit action hooks.
public static function commentAddEdit($comment_ID){ $comment = get_comment($comment_ID); $path = parse_url(get_permalink($comment->comment_post_ID), PHP_URL_PATH); $options = self::getOptions(); GatorCache::getCache($opts = GatorCache::getConfig(self::$configPath)->toArray())->remove($path, $opts['group'], true); } add_action('comment_post', 'WpGatorCache::commentAddEdit'); add_action('edit_comment', 'WpGatorCache::commentAddEdit');
Another thing is that there are still a couple of missing opening
<strong>
tags.
Ex.<p class="bmpTxt"><?php _e('Custom Rules for cache exclusion:', 'gatorcache');?></strong></p>
They are missing on lines: 47, 55, 70, 86, 95, 115 of the options.php
Thanks,
Ron
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘Page cache refresh on comments’ is closed to new replies.