Limiting comment voters per post failing
-
Hi, some I didn’t know anything about php until 1 day ago. I just want to create a function that I can call through an automator, so when an user with a specific role upvotes or downvotes, the downvotes gets deleted.
So I use wpdiscuz and I wanted to just create a function that modifies the comment metadata so that it shows the same amount of up/down votes as before. My automator and everything else works, but the number doesn’t get updated. I have tried a lot of changes and looked everywhere, but I can’t understand what’s wrong with the code.
This is it:
<?php function false_upvote($comment_id) { $vote = get_comment_meta( $comment_id, 'wpdiscuz_votes', true ); return $vote - 1; add_comment_meta( $comment_id, 'wpdiscuz_votes', $vote ); } function false_downvote($comment_id) { $vote = get_comment_meta( $comment_id, 'wpdiscuz_votes', true ); return $vote + 1; add_comment_meta( $comment_id, 'wpdiscuz_votes', $vote ); } ?>
The page I need help with: [log in to see the link]
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Limiting comment voters per post failing’ is closed to new replies.