wpDiscuz 7 API Documentation

  1. Home
  2. Docs
  3. wpDiscuz 7 API Documentation
  4. Actions
  5. wpdiscuz_clean_post_cache
Generic selectors
Exact matches only
Search in title
Search in content
Post Type Selectors

wpdiscuz_clean_post_cache

This action is used to clean the current post cache in some action i.e. add/edit the comment, add a rating, voting, etc.

Changelog

Added in version 7.0.3

Parameters

1. $postId (type: int) – the ID of the post, which caches should be clear
2. $action (type: string) – the action, i.e. add/edit comment, voting, etc

Usage

add_action("wpdiscuz_clean_post_cache", function ($postId, $action) {
    if (function_exists("my_custom_function") && $action === "inline_comment_posted") {
        my_custom_function($postId);
    }
}, 10, 2); 

Was this article helpful to you? Yes No