surveywp / kk-star-ratings

kk Star Ratings wordpress plugin
https://wordpress.org/plugins/kk-star-ratings
Other
118 stars 44 forks source link

Litespeed cache support #133

Closed MichaelRise closed 1 year ago

MichaelRise commented 1 year ago

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

kamalkhan commented 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 and core/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 and Bhittani\StarRating\core\filters\<function_name> for filters.