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.

how can I tell WordPress, that if a user registers, it shall execute my function?

share|improve this question
add comment

1 Answer

up vote 8 down vote accepted

You can use user_register action hook which fires after a user has registered and passes $user_id as a variable:

add_action('user_register','my_function');

function my_function($user_id){
  //do your stuff
}
share|improve this answer
2  
is there any hook just before inserting into database? –  Atif Mohammed Ameenuddin Nov 2 '12 at 21:42
add comment

Your Answer

 
discard

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