#21429 closed enhancement (fixed)
wp_update_user() and wp_insert_user() should accept WP_User
| Reported by: | ryan | Owned by: | ryan |
|---|---|---|---|
| Priority: | normal | Milestone: | 3.5 |
| Component: | Users | Version: | 3.4.1 |
| Severity: | normal | Keywords: | has-patch |
| Cc: | Focuses: |
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.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
Looks good at a glance. to_array(), or maybe actually call it get_object_vars()?