tareq1988 / wp-recaptcha-integration

WordPress reCaptcha integration supporting Ninja Forms and Contact Form 7
https://wordpress.org/plugins/wp-recaptcha-integration
50 stars 31 forks source link

No reCaptcha shown, if 'comment_notes_after' of the comment_form args is used.. #22

Open SamReciter opened 9 years ago

SamReciter commented 9 years ago

I use a custom comments.php - and use the comment_form functions arguments for customizing the comment form. If i use/change the 'comment_notes_after' argument - no reCaptcha is shown. That's pretty annoying as you always have the default text there (the one with the allowed tags). No problem to hide it with display:none via css - but that's one messy workarround =). WP Version is 4.1.1 - your plugin in Version 1.1.1 Greets - great plugin else...

mcguffin commented 9 years ago

@SamReciter the plugin hooks into comment_form_defaults filter with priority 10. If you hook into the same filter a little earlier (like add_filter('comment_form_defaults','something',9);), the captcha should be there again.

SamReciter commented 9 years ago

Thanks you both - i will try @mcguffin 's suggestion and give a feedback later. @Cristian - it's a work on progress for a friends company - i don't know if i can give you more than example code.

<?php $comment_args=array( 'title_reply'=>'', 'fields'=> apply_filters('comment_form_default_fields',array( 'author'=> '

'. '<input id="author" name="author" type="text" value="'.esc_attr($commenter['comment_author']).'" placeholder="Name" size="30"'.$aria_req.' />'. '

', 'email'=> '

'. '<input id="email" name="email" type="email" value="'.esc_attr($commenter['comment_author_email']).'" placeholder=" email@example.com" size="30"'.$aria_req.' />'. '

', 'url'=>'')), 'comment_field'=> '

'. '<textarea id="comment" name="comment" placeholder="Kommentar" cols="45" rows="8"'.$aria_req.'>'. '

', 'comment_notes_before'=>'', /* 'comment_notes_after'=>'' if uncommented, reCaptcha won't show */);

comment_form($comment_args); ?>

Greets...

Jörn Lund notifications@github.com schrieb am Di., 17. März 2015 um 17:22 Uhr:

@SamReciter https://github.com/SamReciter the plugin hooks into comment_form_defaults filter with priority 10. If you hook into the same filter a little earlier (like add_filter('comment_form_defaults','something',9);), the captcha should be there again.

— Reply to this email directly or view it on GitHub https://github.com/mcguffin/wp-recaptcha-integration/issues/22#issuecomment-82443849 .