1
votes

I want to fire function after user finish his registration on my site.

I searched for next hook, but didn't found:

woocommerce_after_customer_register_form

I found only this:

woocommerce_after_checkout_registration_form

That's not help me, because i search for after register form on the site, and not after the checkout.

What is the trick i need to use to fire function after user registered ?

1

1 Answers

14
votes

WordPress core handles user registration and runs the user_register hook right after a user is registered.

Taking from the codex an example would be:

add_action( 'user_register', 'myplugin_registration_save', 10, 1 );

function myplugin_registration_save( $user_id ) {

    if ( isset( $_POST['first_name'] ) )
        update_user_meta($user_id, 'first_name', $_POST['first_name']);

}