wearerequired/js-comment-form-validation

WordPress plugin to add simple comment form validation based on the jQuery Validation plugin.

1.2.0 2019-05-03 13:53 UTC

README

Easy to use client-side form validation for WordPress comments.

Inspired by Instant Comment Validation. Powered by the jQuery Validation plugin.

Hooks & Filters

The plugin provides a filter to change the settings passed to the JavaScript.

js_comment_form_validation_settings Filter

Allows you to filter the data that is sent to the JavaScript, like error messages and minimum required comment length.

add_filter( 'js_comment_form_validation_settings', function( $script_data ) {
	$script_data['rules']['url']['required'] = true;

 	return $script_data;
} );