Home > OS >  wordpress: fire function when update any user is clicked
wordpress: fire function when update any user is clicked

Time:11-18

Related:Wordpress, function after 'update user' is clicked

I have a PHP script that needs to run whenever any user profile is updated in wordpress:

function profile_update() {

    echo "<h2>fired on profile update</h2>";
// do stuff
    add_action( 'edit_user_profile_update', 'profile_update' );

but it does not fire when user is updated. what is happening? this hook is supposed to do the job...

expect action hook to work, unclear whats going wrong.

CodePudding user response:

Please Use below hook for function when update user button is clicked

    function profile_update() {
     echo "<h2>fired on profile update</h2>";
     // do stuff
    }
    add_action('show_user_profile','profile_update');
    add_action('edit_user_profile','profile_update');  
  • Related