how can I tell WordPress, that if a user registers, it shall execute my function?
1 Answer
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
}
-
2
-
1In case that someone want to know @AtifMohammedAmeenuddin question. You can use register_post to hook before register user to db.– veeJul 8, 2015 at 14:23