Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function setPostViews($postID) {
- $countKey = 'post_views_count';
- $count = get_post_meta($postID, $countKey, true);
- if($count==''){
- $count = 0;
- delete_post_meta($postID, $countKey);
- add_post_meta($postID, $countKey, '0');
- }else{
- $count++;
- update_post_meta($postID, $countKey, $count);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement