[wp-trac] [WordPress Trac] #57843: Add action to wp_update_user

WordPress Trac noreply at wordpress.org
Thu Apr 20 15:10:48 UTC 2023


#57843: Add action to wp_update_user
-------------------------+---------------------
 Reporter:  tanner m     |       Owner:  (none)
     Type:  enhancement  |      Status:  new
 Priority:  normal       |   Milestone:  6.3
Component:  Users        |     Version:
 Severity:  normal       |  Resolution:
 Keywords:  has-patch    |     Focuses:
-------------------------+---------------------

Comment (by lphoumpakka):

 Hi,

 The patch works as expected.

 You need to update an user and check $user_id, $userdata, $userdata_raw
 are available.

 You can use this snippet :
 {{{#!php
 <?php
 add_action( 'wp_update_user', function ( $user_id, $userdata,
 $userdata_raw ) {
         echo $user_id;
         print_r( $userdata );
         print_r( $userdata_raw );
         die;
 }, 10, 3 );
 }}}

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/57843#comment:3>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list