Closed MichaelRise closed 1 year ago
add_action('Bhittani\StarRating\core\actions\save', function (float $outOf5, int $id, string $slug, array $payload) {
// The code inside this function will run when a new vote is casted.
}, 10, 4);
All files/functions inside
core/actions
andcore/filters
are action and filter hooks, respectively. To add a new hook to any of those, one just needs to prepend the namespace. e.g.Bhittani\StarRating\core\actions\<function_name>
for actions andBhittani\StarRating\core\filters\<function_name>
for filters.
Hey, rating not work when we use https://wordpress.org/plugins/litespeed-cache/ I checked plugin code but I can't use hooks/filters etc. to clear post/page data after rate.
I found only very old code - https://github.com/kamalkhan/kk-star-ratings/pull/33
PHP: 8.0 WP: 6.1