Title: Perform a function when a user login
Last modified: August 20, 2016

---

# Perform a function when a user login

 *  Resolved [lahoti](https://wordpress.org/support/users/lahoti/)
 * (@lahoti)
 * [13 years, 4 months ago](https://wordpress.org/support/topic/perform-a-function-when-a-user-login/)
 * Hi Milead
 * In my previous login functionality I was performing some extra operations when
   a user registered for the first time. like creating a unique id for that person.
   Is it possible to run that function when someone logins through WSL
    (dont want
   to modify core files but if thats teh last teh option will do that)
 * Please suggest
 * Thanks
 * [http://wordpress.org/extend/plugins/wordpress-social-login/](http://wordpress.org/extend/plugins/wordpress-social-login/)

Viewing 2 replies - 1 through 2 (of 2 total)

 *  Thread Starter [lahoti](https://wordpress.org/support/users/lahoti/)
 * (@lahoti)
 * [13 years, 4 months ago](https://wordpress.org/support/topic/perform-a-function-when-a-user-login/#post-3434185)
 * Just to clarify:
    – I have old users with unique id – so i do not want to overwrite
   their unique ids – Hence, when someone registers/ logins for the 1st time through
   lets say facebook and his matching email is not there then that function should
   run but if matching email is there then that function shouldnt run.
 * Can i use some hook to associate my function with yours
 *  Thread Starter [lahoti](https://wordpress.org/support/users/lahoti/)
 * (@lahoti)
 * [13 years, 4 months ago](https://wordpress.org/support/topic/perform-a-function-when-a-user-login/#post-3434230)
 * Was able to do it using register wordpress hook
 * add_action(‘user_register’, ‘register_unique_id’);

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Perform a function when a user login’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/wordpress-social-login_a1a2bc.svg)
 * [WordPress Social Login](https://wordpress.org/plugins/wordpress-social-login/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wordpress-social-login/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wordpress-social-login/)
 * [Active Topics](https://wordpress.org/support/plugin/wordpress-social-login/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wordpress-social-login/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wordpress-social-login/reviews/)

 * 2 replies
 * 1 participant
 * Last reply from: [lahoti](https://wordpress.org/support/users/lahoti/)
 * Last activity: [13 years, 4 months ago](https://wordpress.org/support/topic/perform-a-function-when-a-user-login/#post-3434230)
 * Status: resolved