Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

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

share|improve this question
add comment

2 Answers

up vote 4 down vote accepted

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 */ ) {
    ...
}
share|improve this answer
    
+1 since you basically said what I said and included example code. :) –  m0r7if3r 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? –  t f Mar 11 '13 at 18:58
    
Thanks a lot. It saved me a lot of time :) –  тнє Sufi Mar 11 '13 at 19:03
add comment

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

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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