Allow reviews with no comment

The below code snippet will allow users to add reviews without entering a comment.

add_filter('allow_empty_comment','myprefix_allow_empty_review',10,2);
function myprefix_allow_empty_review($allow,$commentdata){
	
	if(!empty($_POST['geodir_overallrating']) && empty($_POST['comment_parent'])){
		$allow = true;
	}
	
	return $allow;
}
Did this answer your question? Thanks for the feedback There was a problem submitting your feedback. Please try again later.

Still need help? Contact Us Contact Us