WordPress.org

Ready to get started?Download WordPress

Forums

Captcha
[resolved] Capcha Buddypress Integration (11 posts)

  1. klahla
    Member
    Posted 1 year ago #

    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/

  2. bestwebsoft
    Member
    Plugin Author

    Posted 1 year ago #

    Hello,

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

    Sincerely,
    Oksana

  3. KimK1703
    Member
    Posted 1 year ago #

    Hi Klahla,

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

  4. KimK1703
    Member
    Posted 1 year ago #

    Hi,

    Nevermind, found the answer. It's the functions.php file in the theme folder :)

  5. homeschoolmommy
    Member
    Posted 1 year ago #

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

  6. homeschoolmommy
    Member
    Posted 1 year ago #

    that ok I did It. Thanks for posting the fix

  7. Mod74
    Member
    Posted 1 year ago #

    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.

  8. homeschoolmommy
    Member
    Posted 1 year ago #

    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.

  9. bestwebsoft
    Member
    Plugin Author

    Posted 1 year ago #

    Hello,

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

    Thanks,
    Tatyana

  10. bennygill
    Member
    Posted 1 year ago #

    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?

  11. bestwebsoft
    Member
    Plugin Author

    Posted 1 year ago #

    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.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic