I use this code to limit the comments to 1 for registers users and works fine. The problem is that when i click to "go back" button in the browser i can comment again. Is there any effective way to limit the comments?
Thank you!
global $current_user, $post;
$args = array( 'user_id' => $current_user->ID, 'post_id' => $post->ID );
$usercomment = get_comments( $args );
if ( 1 <= count( $usercomment ) ) {
echo 'disabled';
} else {
comment_form();
}