diff --git a/wp-includes/functions.php b/wp-includes/functions.php index e677fded76..78928c6f29 100644 --- a/wp-includes/functions.php +++ b/wp-includes/functions.php @@ -1168,9 +1168,10 @@ function update_user_cache() { if ( $users = $wpdb->get_results( $query ) ) : foreach ($users as $user) : $metavalues = $wpdb->get_results("SELECT meta_key, meta_value FROM $wpdb->usermeta WHERE user_id = '$user->ID'"); - - foreach ( $metavalues as $meta ) - $user->{$meta->meta_key} = $meta->meta_value; + if ( is_array($metavalues) ) + foreach ( $metavalues as $meta ) + $user->{$meta->meta_key} = $meta->meta_value; + $cache_userdata[$user->ID] = $user; $cache_userdata[$user->user_login] =& $cache_userdata[$user->ID]; endforeach;