Support » Plugin: BuddyPress Registration Options » Gravity Forms Registration Add On

  • Resolved hughshields


    I have built a custom registration form with Gravity Forms Registration Add On and am trying to figure out how to make BP Registration Options work with this custom form. Gravity Forms has options to verify via an email link but this approves the user upon activation of the link and does not allow the BP Registration Options workflow to work.
    Does anyone have experience making BP Registration Options work with a custom form?

Viewing 12 replies - 1 through 12 (of 12 total)
  • Plugin Author Michael Beckwith


    on the bp_core_activate_account hook, if the “key” $_GET parameter, which I believe comes from the WP activation link, is set we update the user_status value in the DB to “69”. Don’t ask me why that number, I wasn’t part of the original development 😀 We also set a “hide_sitewide” field to 1 aka true, in the bp_activity table.

    The moment you approve the user, the user_status is set to 0, an the hide_sitewide is set to 0 aka false.

    //Hide user created by new user on activation.
    $sql = 'UPDATE ' . $wpdb->base_prefix . 'users SET user_status = 69 WHERE ID = %d';
    $wpdb->query( $wpdb->prepare( $sql, $user_id ) );
    //Hide activity created by new user
    $sql = 'UPDATE ' . $wpdb->base_prefix . 'bp_activity SET hide_sitewide = 1 WHERE user_id = %d';
    $wpdb->query( $wpdb->prepare( $sql, $user_id ) );

    Thanks for the information. I appreciate it.
    When I register a new user using the Buddypress Registration process the BP Registration Options approval process works perfectly. When I try to register using the custom Gravity forms registration the new user is activated automatically. I did notice that the mails sent are slightly different:

    Buddypress Registration Activation link:

    Gravity Forms Registration Activation link:

    I haven’t been able to come up with a fix yet. Still turning up clues.
    Thanks again for your input.

    Plugin Author Michael Beckwith


    It may not be a bad idea for WebDevStudios to offer GravityForms integration for our plugin here. It’s something that we’d have to look into and do up, and I can’t make any guarantees.

    I think you got your links reversed, but I get the idea anyway 😀

    Hopefully you can get this working in your own way though. Let me know if you have any other questions or need more info.

    You are correct. I reversed the links. The one with “gf” is obviously Gravity Forms. Sorry about that!

    I think I found a solution which I will pass along in case someone else has the same issue. I turned off all Additional Options in Gravity Forms Registration Add On so that no verification email is sent by Gravity forms. I then added the following to the functions.php in my child theme:

     * GF Registration Process Set User to Not Authenticated to enable verification
    function gf_bp_profile_activation( $user_id ) {
        global $wpdb;
         //Update the user status to '69' which we will use as 'not activated' (0 = active, 1 = spam, 69 = not active)
        $wpdb->query( $wpdb->prepare( "UPDATE {$wpdb->users} SET user_status = 69 WHERE ID = %d", $user_id ) );
        if ( !is_multisite() ) {
            $activation_key = wp_hash( $user_id );
            $userdata = get_userdata($user_id);
            update_user_meta( $user_id, 'activation_key', $activation_key );
            if ( apply_filters( 'bp_core_signup_send_activation_key', true ) ) {
                bp_core_signup_send_validation_email( $user_id, $userdata->user_email, $activation_key );
    add_action( 'gform_user_registered', 'gf_bp_profile_activation', 11 );

    If you are thinking about integrating BP Registration Options with Gravity Forms Registration Add On then a list of developer hooks and filters for the GF Registration Add On can be found at:

    The one that looks particularly interesting is:
    Used to add a group of options to the “Additional Options” section of the User Registration Feed. Useful when you want to add one or two options without requiring a whole section.

    You could potentially add a BP Registration Options choice to the Gravity Forms Additional Options menu.

    On closer look the above code has a few flaws. Firstly the user is showing up immediately in the activity feed as registered, although the member profile does not display. Also when I approve a new member the member count on the Members page does not increase for some reason.
    The issue with the activity feed I believe is because I did not set hide_sitewide to 1 in the above function. But I am not sure why the member count is not working. Any ideas?

    Plugin Author Michael Beckwith


    I would assume the other parts of what the code does is why the member count doesn’t increment. However, if this is for users you approved and it doesn’t increment, then it’s something else that I’d need to check on.

    Hi Michael,
    I tested out adding new members using the default buddypress registration with BP Registration Options and the member number doesn’t work there either, so it appears to be a BP Registration Options plugin issue and is not related to Gravity Forms.
    Have you run into problems with the member number not incrementing before, and if so any known fix.

    Plugin Author Michael Beckwith


    I hadn’t noticed it myself, and I can’t recall anyone having reported the issue either, so I don’t have any ideas on fixing it at the moment. I’ll definitely file an issue for myself for later so I can check it out and possibly solve.

    It looks like when a new user logs in for the first time in Buddypress the total member cache is deleted and then recounted.
    I assume that BP Registration Options suppresses this, but at approval should then should recount the members. I poked around the plugin but couldn’t find the code for this.

    Plugin Author Michael Beckwith


    I’ll have to look into tinkering with that cache then. Thanks for pointing that much out 😀

    Plugin Author Michael Beckwith


    hughshields, You’ll want to test your modifications with I definitely redid a lot of the underlying code, including how it’s marked that a user is still in moderation. Primarily I moved to user meta instead of user status.

    Let me know if any questions or issues come up with this. Hoping the code and whatnot is better and more solid with restriction.

Viewing 12 replies - 1 through 12 (of 12 total)
  • The topic ‘Gravity Forms Registration Add On’ is closed to new replies.