diff --git a/wp-includes/user-functions.php b/wp-includes/user-functions.php index fd73875958..9e95bee6c7 100644 --- a/wp-includes/user-functions.php +++ b/wp-includes/user-functions.php @@ -1102,9 +1102,18 @@ function sanitize_user_field($field, $value, $user_id, $context) { * * @since 3.0.0 * - * @param object $user User object to be cached + * @param object|WP_User $user User object to be cached + * @return bool|null Returns false on failure. */ -function update_user_caches($user) { +function update_user_caches( $user ) { + if ( $user instanceof WP_User ) { + if ( ! $user->exists() ) { + return false; + } + + $user = $user->data; + } + wp_cache_add($user->ID, $user, 'users'); wp_cache_add($user->user_login, $user->ID, 'userlogins'); wp_cache_add($user->user_email, $user->ID, 'useremail'); diff --git a/wp-includes/version.php b/wp-includes/version.php index 6e5d5d9c01..bebc61f0b0 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -4,7 +4,7 @@ * * @global string $wp_version */ -$wp_version = '4.4-alpha-34918'; +$wp_version = '4.4-alpha-34919'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.