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:
Ryan Boren
2012-08-10 15:36:54 +00:00
parent d79594b872
commit 9580f65af6
4 changed files with 30 additions and 8 deletions

View File

@@ -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;