‘stats_get_csv’ function returns an empty array
-
Hi!
I’m using this code to obtain the IDs of the most popular posts in a website:
if ( function_exists( 'stats_get_csv' ) ) { $popular = stats_get_csv( 'postviews', array( 'days' => 5, 'limit' => 25 ) ); $popular_ids = array(); foreach ( $popular as $p ) { if ( $p['post_id'] != 0 ) { $popular_ids[] = $p['post_id']; } } $popular_count = count($popular_ids); }The problem is that this line is returning an empty array:
$popular = stats_get_csv( 'postviews', array( 'days' => 5, 'limit' => 25 ) );This was working fine until a few days ago. The Jetpack plugin is updated and activated and I can see the statistics, do you know what could be happening?
Thanks, regards.
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
The topic ‘‘stats_get_csv’ function returns an empty array’ is closed to new replies.