wpDiscuz 7 API Documentation

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

wpdiscuz_add_rating

This hook can be used to perform an action when a post is being rated.

Changelog

Added starting from 7.0.0 version.

Parameters

1. $rating (type: int) – the rating made by the user.
2. $postId (type: int) – the rated post ID.

Usage

add_action("wpdiscuz_add_rating", function ($rating, $postId) {
    if (function_exists("my_custom_function")) {
        my_custom_function($rating, $postId);
    }
}, 10, 2);

Was this article helpful to you? Yes 1 No 1