#21429 closed enhancement (fixed)
wp_update_user() and wp_insert_user() should accept WP_User
Reported by: | ryan | Owned by: | ryan |
---|---|---|---|
Milestone: | 3.5 | Priority: | normal |
Severity: | normal | Version: | 3.4.1 |
Component: | Users | Keywords: | has-patch |
Focuses: | Cc: |
Description
These functions currently accept only an array of user data. This encourages using wp_update_user( get_object_vars( $user ) ). If $user happens to be a WP_User instance, this will fail since WP_User doesn't declare object vars. wp_update_user() and wp_insert_user() should accept WP_User and handle running get_object_vars() on WP_User::data.
Attachments (2)
Change History (5)
Note: See
TracTickets for help on using
tickets.
Looks good at a glance. to_array(), or maybe actually call it get_object_vars()?