Commit ab6604c5 authored by Rafael Chaves Freitas's avatar Rafael Chaves Freitas

prevent multiple calls of \AjaxPageviews::get_top_viewed

parent e00b6acc
......@@ -109,6 +109,8 @@ function get_posts_ranking() {
$ids = wp_cache_get( $cache_key );
if ( $ids === false ) {
wp_cache_add( $cache_key, [], MINUTE_IN_SECONDS );
$most_viewed = \AjaxPageviews::get_top_viewed(500, ['post_type' => 'post', 'from' => date('Y-m-d H:00', strtotime('-24 hour'))]);
$ids = array();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment