I have designed a plugin and in a part of its functionalities I'm trying to save some data to a custom table in MySQL based on the ID of new registered user in Wordpress registration form. I used user_register hook as follow:
function my_func($user_id){
// some DB Query code based on $user_id
}
add_action('user_register', 'my_func', 10, 1);
I already tried solution in Wordpress user_register hook not executing? and used profile_update hook as described there but it couldn't help. I also tried changing priority value and removed it but the problem still exists.
The only thing I want is to have access to ID of the new registered user in registration form. I appreciate if someone could help me.