WordPress.org

Support

Support » Plugins and Hacks » [Resolved] [Plugin: Captcha] Capcha Buddypress Integration

[Resolved] [Plugin: Captcha] Capcha Buddypress Integration

  • klahla
    Member

    @klahla

    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.7

    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 '<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,

    http://wordpress.org/extend/plugins/captcha/

Viewing 10 replies - 1 through 10 (of 10 total)
  • Plugin Author bestwebsoft
    Participant

    @bestwebsoft

    Hello,

    Thank you, we will recommend your method to users who will be interested in Captcha and Buddypress registration form integration.

    Sincerely,
    Oksana

    KimK1703
    Member

    @kimk1703

    Hi Klahla,

    Thank you so much for this fix! 🙂
    Is it the /wp-includes/functions.php file you are referring to?

    KimK1703
    Member

    @kimk1703

    Hi,

    Nevermind, found the answer. It’s the functions.php file in the theme folder 🙂

    homeschoolmommy
    Member

    @homeschoolmommy

    where exactly in the functions.php do I add this code
    could you tell me what row in my theme functions.php. thank you

    homeschoolmommy
    Member

    @homeschoolmommy

    that ok I did It. Thanks for posting the fix

    Thanks for this, worked great dropped at the end of the theme Functions.php file.

    The box doesn’t line up nice on the BuddyPress registration page, but if you change

    echo '<div class="register-section" style="float:left; width:48%;">';

    to

    echo '<div class="register-section" style="float:right; width:48%;">';

    It does fine.

    homeschoolmommy
    Member

    @homeschoolmommy

    o yea one problem occured when the code is put in. when crunching photos for featured image get an error. it worked before the code is place. and it works with the multisite but not the main site. main site gets error, multisite does not. is there a way to fix that any idea.

    Plugin Author bestwebsoft
    Participant

    @bestwebsoft

    Hello,

    please provide your opinion – whether everything works good on multisite or not?

    Thanks,
    Tatyana

    bennygill
    Participant

    @bennygill

    I have added this to functions.php but it’s still not working?

    I’m using a different theme (skematik) then the default BuddyPress theme. Is that the problem?

    Plugin Author bestwebsoft
    Participant

    @bestwebsoft

    hello bennygill,

    Unfortunately, we can’t help you to insert captcha to the Buddypress theme. Because it has a lot of nuances and conflicts, which appear with Capcha + Buddypress work. Sorry for this inconvenience. Perhaps, other users can help you.

    Kind regards.

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘[Resolved] [Plugin: Captcha] Capcha Buddypress Integration’ is closed to new replies.