Skip to:
Content
Pages
Categories
Search
Top
Bottom

How to Modify/Change a Buddypress/WordPress Account Activation Process


  • William
    Participant

    @william_oneb

    I’m developing a custom BuddyPress/WordPress Plugin. Here’s how a user would normally register.

    1) A user registers as usual on registration page
    2) His/Her account is deactivated till he/she clicks on activation link in his/her email
    3) He/She is sent an activation link through the email he/she registered with
    4) He/She activates his account by clicking on the link

    I’d like to modify step 4 above so that even if the user clicks on the activation link, his/her account remains deactivated till he/she fills another form on the site for example, a custom survey form. Once this form is filled successfuly, the user can now be activated.

    I’ll be programming the custom form myself so that it works the way I want it to, with wordpress/Buddypress actions/filters.

    So my question is: How can you modify the WordPress/Buddypress activation Process so that the account remains deactivated till the user fill my custom form?

    Here’s the main action that I intend to use and it fires as soon as the user clicks the buddypress account activation link in their email:

    bp_core_signup_user

    I’ll appreciate if someone can point in the right direction on modifying the Buddypress/Wordpress activation process.

    Please help. This is where I’m stuck.

    I’m using:

    Buddypress: 2.3.3
    Wordpress: 4.3.1

Viewing 2 replies - 1 through 2 (of 2 total)

  • modemlooper
    Moderator

    @modemlooper

    hook into the filter bp_core_signup_send_activation_key and send a different email message linking them to the form you want them to fill out. On your form submission you can then do the activation link

    		/**
    		 * Filters if BuddyPress should send an activation key for a new signup.
    		 *
    		 * @since BuddyPress (1.2.3)
    		 *
    		 * @param bool   $value          Whether or not to send the activation key.
    		 * @param int    $user_id        User ID to send activation key to.
    		 * @param string $user_email     User email to send activation key to.
    		 * @param string $activation_key Activation key to be sent.
    		 * @param array  $usermeta       Miscellaneous metadata about the user (blog-specific
    		 *                               signup data, xprofile data, etc).
    		 */
    		if ( apply_filters( 'bp_core_signup_send_activation_key', true, $user_id, $user_email, $activation_key, $usermeta ) ) {
    			bp_core_signup_send_validation_email( $user_id, $user_email, $activation_key );
    		}
    

    William
    Participant

    @william_oneb

    Thanks @modemlooper. This is doable but will the account remain deactivated as usual? The user might justchoose to ignore the second email with activation link since they can already login. What do you say? I’d like to sort of force a user to fill the second form and I don’t want them logging in if they haven’t filled the second form.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘How to Modify/Change a Buddypress/WordPress Account Activation Process’ is closed to new replies.
Skip to toolbar