How to validate recaptcha on comments form?
I've added the following code to my function file to add the recaptcha, however I do not know how I can validate the captcha.
/**
* Add Captcha to Comments Form
*/
add_filter('comment_form', function() {
echo 'div class="g-recaptcha" data-sitekey="'.GOOGLE_RECAPTCHA_SITEKEY.'"/div';
});
Is there a filter for the submission of the comments form? I will be validating the captcha server side using the following:
Any advise on how to implement the captcha to the comments form would be appreciated.