Reading at the original thread, sounds confusing.
What I meant was, in includes/columns.php there should be added condition to check if the post views was edited or not by the author when the post is being saved. Currently, on each post update the post views is updated which shouldn’t happen.
So, after this line in the save_post function:
// is post views set
if ( ! isset( $_POST['post_views'] ) )
return $post_id;
There should be a check that will prevent an update if the field wasn’t changed (can happen if the post edit screen was opened and new views occurred in the meantime).
if (isset($_POST['current_post_views']) && $_POST['current_post_views'] == $_POST['post_views'])
return $post_id;
-
This reply was modified 7 years, 10 months ago by dblazeski.