[Plugin: Captcha] Capcha Buddypress Integration
-
This captcha plugin was the only one that I considered great and worked with no conflicts with other plugins on my site. However I have buddypress and “as is” currently it does not allow for the Buddypress registration verification.
Based on this guide:
http://wordpress.org/support/topic/set-custom-registration-form-url-for-captcha?replies=2
I wrote some code that works for me. Thought it may be helpful to others.Tested on:
WordPress v. 3.4.1
BuddyPress v. 1.5.7Steps:
1. Download, activate captcha plugin
2. Add the following code to your functions.php/////////////////////////////////////////////////////////////// // captcha - buddypress - registration inregration - start /////////////////////////////////////////////////////////////// function bp_reg_captcha() { global $bp; if( function_exists( 'cptch_display_captcha_custom' ) ) { echo '<div class="register-section" style="float:left; width:48%;">'; echo '<label>Human Verification (required)</label>'; if (!empty($bp->signup->errors['captcha_response_field'])) { echo '<div class="error">'; echo "Please complete the verification."; echo '</div>'; } echo "<input type='hidden' name='cntctfrm_contact_action' value='true' />"; echo cptch_display_captcha_custom(); echo '</div>'; } } function bp_reg_captcha_validate($errors) { global $bp; if(function_exists( 'cptch_check_custom_form' ) && cptch_check_custom_form() !== true ) { $bp->signup->errors['captcha_response_field'] = "Error."; } return; } add_action( 'bp_before_registration_submit_buttons', 'bp_reg_captcha' ); add_action( 'bp_signup_validate', 'bp_reg_captcha_validate' ); /////////////////////////////////////////////////////////////// // captcha - buddypress - registration inregration - end ///////////////////////////////////////////////////////////////
Thanks for a great plugin.
Cheers,
Viewing 10 replies - 1 through 10 (of 10 total)
Viewing 10 replies - 1 through 10 (of 10 total)
- The topic ‘[Plugin: Captcha] Capcha Buddypress Integration’ is closed to new replies.