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

@@ -665,6 +665,17 @@ class WP_User {
return $this->__isset( $key );
}
/*
* Return an array representation.
*
* @since 3.5.0
*
* @return array Array representation.
*/
function to_array() {
return get_object_vars( $this->data );
}
/**
* Set up capability object properties.
*