WordPress.org

Ready to get started?Download WordPress

Forums

Where to add codes when a new user register (2 posts)

  1. ian.vizarra
    Member
    Posted 2 years ago #

    hi, I'm new to wordpress. I'm trying to find the exact place where wordpress execute the code when the user register to your site. I wanted to add some code where it will also sent some data to another database. is this possible? thank you whoever will respond to my question.

    Kind Regards,
    Ian

  2. bcworkz
    Member
    Posted 2 years ago #

    There's not really an exact place, a lot of code happens in different places. Doesn't really matter, all you need is a good hook to latch onto to get your code executed. You might try the action 'user_register'. From there, what you do is only limited by php, so yes, you can put data into another database. Your hook code is only passed the user ID, so you'll have to figure out how your code accesses the info you'll be adding to the database. Maybe a global array? Or from a php superglobal populated by a form submit?

Topic Closed

This topic has been closed to new replies.

About this Topic