I am trying to hide the comments form if a user has left a comment on that particular post, otherwise display the comment form.
I added a code snippet to a hook which hides the form, but reverts to the WordPress comment form. I'm unable to figure out how to hide that form! I would also be open to hiding that entire column if need be.
Thanks to @squints for his post
function hide_review_form( $review_form ) {
global $current_user, $post;
$usercomment = get_comments(array('user_id' => $current_user->ID,'post_id' => $post->ID) );
if (! $usercomment) {
return $review_form;
}
}
add_filter( 'woocommerce_product_review_comment_form_args', 'hide_review_form' );