I want to call a function, whenever any user update their profile. How to do that?


It seems as if the hook personal_options_update might be what you're looking for.

add_action( 'personal_options_update', 'my_custom_func' );
function my_custom_func( $user_id /* if you need that */ ) {
  • +1 since you basically said what I said and included example code. :) – mor7ifer Mar 11 '13 at 17:26
  • Thanks a lot. Can I also use this hook in plugin as well? – тнє Sufi Mar 11 '13 at 18:02
  • Well, of course can you include this functionality into a plugin, as well as into a theme's functions.php. If I could be of help, would you mind accepting this answer so that someone having the same/a similar problem can see its solution? – tfrommen Mar 11 '13 at 18:58

You can do this using either the personal_options_update or edit_user_profile_update hook depending on what exactly you want to do. If those aren't firing when you need, you can poke around in http://core.trac.wordpress.org/browser/tags/3.5.1/wp-admin/user-edit.php to find a different hook to use.

See Justin Tadlock's tutorial for more

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.