Limit user to one comment

is there a nice function I can use to limit logged in users to one comment per post? I’m setting up a review system and only one review permitted per user. Thanks.

Related posts

Leave a Reply

2 comments

  1. See if this still works:

    <?php
    global $current_user;
    $args = array('user_id' => $current_user->ID);
    $usercomment = get_comments($args);
    if(count($usercomment) >= 1){
        echo 'disabled';
    } else {
        comment_form();
    }
    ?>
    

    My source