- This topic has 5 replies, 2 voices, and was last updated 10 years, 11 months ago by
Pie Register.
- AuthorPosts
- August 29, 2015 at 5:15 am #10003903
Andrea BettelliParticipantHi,
Please … I would like to know how and where you could work with the code, to get the updating of some user_meta at the moment of the Login and some other user_meta at the moment of Logout.
Login and Logout from your link in the widget.
Thanks
AndreaSeptember 1, 2015 at 4:52 pm #10003915
Pie RegisterParticipantHello Andrea,
You can use following hooks on Login
wp_login
piereg_admin_login_before_redirect_hook
piereg_user_login_before_redirect_hookFor logout PR uses wp_logout() so you will have wp_logout to hook yur function.
Thanks
September 1, 2015 at 6:54 pm #10003919
Andrea BettelliParticipantHi Hasnain Abbas,
please, may I ask you to write a complete example for update_user_meta (pippo) for the event of Login and a complete example for update_user_meta (pappa) for the event of Logout functions?
Thank you!
AndreaSeptember 2, 2015 at 4:20 pm #10003933
Pie RegisterParticipantHello,
Here’s the example:
for Login:
add_action(‘wp_login’,’myCustomLoginHook’, 10, 2);function myCustomLoginHook($username,$userObject){
//Do Something
}for Logout:
add_action(‘wp_logout’,’myCustomLogoutHook’);function myCustomLogoutHook(){
//Do Something
}Hope it helps
Thanks
September 2, 2015 at 5:13 pm #10003936
Andrea BettelliParticipantHi Hasnain Abbas,
That’s work fantastic!
Thank you very much!Sorry … have you the time for explain me what are the last 2 numbers of the code?
add_action(‘wp_login’,’myCustomLoginHook’, 10, 2);Why is there on the Login function, but not on the Logout function?
Thanks a lot again, gentleman!
AndreaSeptember 3, 2015 at 3:18 pm #10003939
Pie RegisterParticipantI am glad you got it working.
Well, those are arguments number that are being passed to your custom function.
in logout hook there is no param to pass.Your input matters. Please give us your favorable rating at WordPress Just please click here.
https://wordpress.org/support/view/plugin-reviews/pie-registerThanks
- AuthorPosts
- The forum ‘Pie-Register 2.0 Support’ is closed to new topics and replies.
