mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-04-01 11:14:36 +00:00
Allow passing stdClass and WP_User to wp_insert_user() and wp_update_user(). Introduce WP_User::to_array(). Eliminate uses of get_object_vars() when passing to wp_*_user(). fixes #21429
git-svn-id: https://develop.svn.wordpress.org/trunk@21496 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -156,9 +156,9 @@ function edit_user( $user_id = 0 ) {
|
||||
return $errors;
|
||||
|
||||
if ( $update ) {
|
||||
$user_id = wp_update_user( get_object_vars( $user ) );
|
||||
$user_id = wp_update_user( $user );
|
||||
} else {
|
||||
$user_id = wp_insert_user( get_object_vars( $user ) );
|
||||
$user_id = wp_insert_user( $user );
|
||||
wp_new_user_notification( $user_id, isset($_POST['send_password']) ? $pass1 : '' );
|
||||
}
|
||||
return $user_id;
|
||||
|
||||
Reference in New Issue
Block a user