Some new posts gets random amount of likes
-
In order to avoid posts with 0 votes not showing up, I am using this script to give every new post 1 value.
function thumbs_rating_setup($post_ID) { global $wpdb; if(!wp_is_post_revision($post_ID)) { add_post_meta($post_ID, '_thumbs_rating_up', '1', true ); } } add_action('publish_page', 'thumbs_rating_setup'); add_action('publish_post', 'thumbs_rating_setup');
This script works fine, but for some reason every 6th post gets 20-50 vote ups. I checked my Function file and the code above is the only function that touched ‘_thumbs_rating_up’. Any idea what might have caused it or if there’s a better approach?
Viewing 10 replies - 1 through 10 (of 10 total)
Viewing 10 replies - 1 through 10 (of 10 total)
- The topic ‘Some new posts gets random amount of likes’ is closed to new replies.