remove views count _meta_fields.php

because its not working here
This commit is contained in:
Nabeel Shar 2023-12-28 00:16:10 +05:00 committed by GitHub
parent ff51b85152
commit c041f39561
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -4052,26 +4052,3 @@ add_action( 'save_post', 'fictioneer_save_recommendation_metaboxes' );
?>
<?php
/**
* Post Views
*
*/
function set_post_views($post_id) {
$key = 'post_views';
$count = get_post_meta($post_id, $key, true);
$count = (empty($count)) ? 1 : $count + 1;
update_post_meta($post_id, $key, $count);
}
function track_post_views() {
if (is_single() && get_post_type() == 'fcn_story') {
set_post_views(get_the_ID());
}
}
add_action('wp', 'track_post_views');
?>