User add event

Permalink
In a recent project I worked on, I found myself needing to hook up to on_user_add on order to do some processing on the newly added user. However, it seems that the event is triggered before any attributes are saved against the user, which is slightly inconvenient if you need to rely on those attributes.

At this point, you can take on of the 2 solutions:
1. Rely in the $_POST to get additional attribute values that the user entered in the registration form(nasty approach).
2. Overwrite the core functionality that adds the user(nastiest approach).

Wouldn't it be more useful if the on_user_add event was triggered after all the attributes are saved against the user or if a new event was created called something like on_user_add_completed that would trigger, again, after all the attributes are saved?

 
JohntheFish replied on at Permalink Reply
JohntheFish
Depending on what you want to do with the attributes, it could be a little more complicated that that. The actual saved attribute values don't read back from the database until the next page load. So the event could at best only use what the user has entered and tried to save, not what has actually been saved.

This website stores cookies on your computer. These cookies are used to improve your website experience and provide more personalized services to you, both on this website and through other media. To find out more about the cookies we use, see our Privacy Policy.