How to get user ID during registration and add it to a custom table

I am trying to get the user ID during registration and automatically add that ID to my custom table. I am using the WP-Members plugin for registration.

Is it possible to get user ID on the fly while registering and add that ID to another custom table with WP-Members plugin.

Or I could use a custom registration page if required; but I need some guidance how to get user ID on the fly during registration.

Anyone please help me…

3 Answers
3

Please take a look at user_register hook

This is fired when a new user is registered and conveniently passes you the user ID of the new user.

function function_name( $user_id )
{        
    /* do what you want to do with ID here */
}
add_action( 'user_register', 'function_name');

Leave a Comment