[wp-trac] [WordPress Trac] #50062: Updating user extra fields.
WordPress Trac
noreply at wordpress.org
Sun May 3 00:52:54 UTC 2020
#50062: Updating user extra fields.
--------------------------+-----------------------------
Reporter: Alienoiduk | Owner: (none)
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Users | Version: 5.4
Severity: major | Keywords:
Focuses: |
--------------------------+-----------------------------
Hi in creating a plugin i have extra fields in the users profile. I can
add these at registration and even as a new user from administration panel
but this does not work when updating the user.
I am using the hook 'edit_user_created_user' in the file
wp-admin/includes/user.php lines 227 - 242
{{{
if ( $update ) {
$user_id = wp_update_user( $user );
} else {
$user_id = wp_insert_user( $user );
$notify = isset( $_POST['send_user_notification'] ) ?
'both' : 'admin';
/**
* Fires after a new user has been created.
*
* @since 4.4.0
*
* @param int $user_id ID of the newly created user.
* @param string $notify Type of notification that should
happen. See wp_send_new_user_notifications()
* for more information on possible
values.
*/
do_action( 'edit_user_created_user', $user_id, $notify
);<------ THIS LINE
}
<------SHOULD BE HERE
}}}
If the do action is moved down one line then it will work for new users
and updating users.
I think that is correct.
Thank you
Simon
--
Ticket URL: <https://core.trac.wordpress.org/ticket/50062>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list