Skip to content

Instantly share code, notes, and snippets.

@mcguffin
Created January 3, 2015 10:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mcguffin/97d7f442ee3e92b7412e to your computer and use it in GitHub Desktop.
Save mcguffin/97d7f442ee3e92b7412e to your computer and use it in GitHub Desktop.
<?php
/*
Plugin Name: WP reCaptcha comment form fix
Plugin URI: https://gist.github.com/mcguffin/97d7f442ee3e92b7412e
Description: Will bring back reCaptcha to comment form
Author: Jörn Lund
Author URI: http://github.org/mcguffin
Version: 0.0.1
*/
function recaptcha_comments_init() {
if ( class_exists( 'WP_reCaptcha' ) ) {
$rec = WP_reCaptcha::instance();
if ( $rec->is_required() )
add_action( 'comment_form_after_fields' , array( $rec , 'print_recaptcha_html' ) , 10 , 0 );
}
}
add_action('init','recaptcha_comments_init');
@Feriman22
Copy link

Dear Developer,

Could you integrate this fix in your plugin?

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment