• Resolved ronangelo

    (@ronangelo)


    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

    https://wordpress.org/plugins/gator-cache/

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author GatorDog

    (@gatordog)

    Hi Ron,

    Thanks for letting me know about the comments updating and the options template html. As you mentioned, the “comments_edit” hook is needed for when comments are updated. The “comments_post” hook may already be covered by the current “comments_transition” hook since it’s for newly published content. Will have to take a look at the codex and see. Will put together a release for these additions soon.

    Thanks,

    Schuyler

    Plugin Author GatorDog

    (@gatordog)

    Took a look and the transition_comment_status hook you mentioned does only fire when the comment status changes. This is unlike the post transition hook, which always fires. To accomodate this, the comments_edit hook was added as well as the wp_insert_comment hook for new comments. The latter happens just before comment_post and will work when comments are directly added from wp_insert_comment. Thanks again for letting me know about these issues. The latest release, version 1.45, contains both fixes for insert and editing comments.

    Thread Starter ronangelo

    (@ronangelo)

    No problem. Thanks for looking into it.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Page cache refresh on comments’ is closed to new replies.