Support For WP-Fastest Cache
-
WP-PostRatings does not work well with caching plugins because the plugin is dated and I have no time to rewrite it as I have a full time job.
If you need it to work with WP-Fastest Cache, add this code in your theme functions.php
add_action( 'rate_post', 'wp_postratings_clear_fastest_cache', 10, 4 ); function wp_postratings_clear_fastest_cache( $post_id, $post_ratings_users, $post_ratings_score, $post_ratings_average ) { if ( isset( $GLOBALS['wp_fastest_cache'] ) && method_exists( $GLOBALS['wp_fastest_cache'], 'singleDeleteCache' ) ) { $GLOBALS['wp_fastest_cache']->singleDeleteCache( false, $post_id ); } }
The function above will clear the cache whenever a post is rated, ensuring the post will always be up to date.
Viewing 7 replies - 1 through 7 (of 7 total)
Viewing 7 replies - 1 through 7 (of 7 total)
- The topic ‘Support For WP-Fastest Cache’ is closed to new replies.