0

I have a server elastic-search instance running, as well as an off-site firebase data account. What I am trying to do is basically fire a curl request to create certain user fields with data once the user creates an account. The site automatically checks for these values once the user logs in (I did this by automatically firing the command once a certain page loads which every user is redirected to when they log-in). I am also running angularjs so I have that option as well. It's just that I really have no idea what php function to use or anything that fires once a user is created.. Any ideas on how to get this done?

2
//This action hook allows you to access data for a new user immediately after they are added to the database. The user id is passed to hook as an argument.
    do_action( 'user_register', $user_id );

so you could:

add_action('user_register','my_user_register_function');

function my_user_register_function($user_id)
{
$user = get_user_by( 'ID', $user_id );
//your CURL stuff
}
0

You may want to wait until the user is activated by BuddyPress.

Try using this hook:

do_action( 'bp_core_activated_user', $user_id, $key, $user ); 

Located in: buddypress\bp-members\bp-members-functions.php in function bp_core_activate_signup

  • I have users automatically activated (no e-mail validation).. Does this command fire automatically still? Or only when activation is turned on and they validate via their e-mail? – Genesis May 7 '16 at 21:14
  • afaik, the hook will work either way. Easy enough to test, eh? – shanebp May 8 '16 at 13:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.