Right now, our meta that we tie to the user isn’t set until the activation of the account, which is one of the emails they receive. We run this on the user_register action hook from WordPress core.
Is this email validation different from that activation email I’m referring to?
If there’s a different hook that would be passed the user ID in question, it should theoretically be possible to unhook our default one, and hook into the new one.
Thread Starter
reedy
(@reedy)
I’m not 100% sure if we’re on the same page. On my site (I believe this is default behavior, but perhaps not) when someone registers they are sent an email with the subject line ‘[Site Name] Activate your account’. This email asks the user to click a link to complete account activation. When the user clicks this link, I get an email from WordPress telling me a new user has registered. The user also sees the BuddyPress Registration Options message about awaiting approval when they click the validation link.
However, I notice that as soon as someone registers (when they are sent the ‘[Site Name] Activate your account’) email, they are immediately added to the BuddyPress Registration Options Member Requests list — even if they haven’t clicked the activation link yet.
Is this normal behavior? I was hoping to have members only added to the BuddyPress Registration Options Member Requests list AFTER they click the BuddyPress validation link in the ‘[Site Name] Activate your account’ email.
Does this make sense?
We’re on the same overall “page” more than perhaps believed.
As is, what you’ve described is normal behavior for how we have things set up. We act once the user has been created in the WP site, you’re wanting to not mark them as pending until after they’ve activated.
Try out the following snippet. It should go in your active theme’s functions.php file.
remove_action( 'user_register', 'bp_registration_options_bp_core_register_account' );
add_action( 'bp_core_activated_user', 'bp_registration_options_bp_core_register_account' );
In short, we remove our handling from the “user_register” hook, and instead run it at the point of the user activating.