Get post view by dates
-
Hi, i’m trying implement a function that will retrieve post view by dates but it’s not working for me. this is what i use:
function get_post_views_data($post_id) {
$views_data = array();for ($i = 0; $i < 30; $i++) { $date = date('Ymd', strtotime("-$i days")); $views = pvc_get_post_views($post_id, $date, $date); $views_data[$date] = $views; } return array_reverse($views_data); // Chronological order
}
Can you advice what hook should i use to get the post view dates?
Thanks in advance,
Simon.
- The topic ‘Get post view by dates’ is closed to new replies.