net

Captcha Buddypress Integration

Steps:
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 '

';
echo '';
if (!empty($bp->signup->errors['captcha_response_field'])) {
echo '

';
echo "Please complete the verification.";
echo '

';
}
echo "";
echo cptch_display_captcha_custom();
echo '

';
}
}

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,
http://wordpress.org/extend/plugins/captcha/

Share this: