Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

Is there a hook in WP to access meta data of a user JUST after they have registered and meta data has been added to the database?

I was reading to use profile_update, but wouldn't that be invoked every time they update their profile? I just want something to occur the moment that they have registered, and the users meta has been entered in to the database.

Please let me know,

Thanks!

Tre

share|improve this question
add comment

1 Answer

up vote 3 down vote accepted

You can use user_register

add_action('user_register', 'wpse42506_user_register', 10, 3);
function wpse42506_user_register( $user_ID ) {
    // do stuff here
}

If you want to just use the user information, you can use get_userdata http://codex.wordpress.org/Function_Reference/get_userdata

If you need more control, you can initiate a new WP_User http://codex.wordpress.org/Class_Reference/WP_User

share|improve this answer
    
Yeah, I was looking at that too. But someone said that it won't give me access to meta values like first name and last name, so I didn't try. Was that false? –  tr3online Feb 16 '12 at 4:01
    
It passes the $user_ID. So you will have access to everything about the user. I updated my answer with more information –  imHavoc Feb 16 '12 at 4:02
    
Cool, I'll have a look. I guess that post I read was a lie :\ Or miss-informed. Thanks! –  tr3online Feb 16 '12 at 4:17
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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