From af294103b4ec79c4ef82ad3f3ddc0f3eeef900e7 Mon Sep 17 00:00:00 2001 From: Evan Mattson Date: Thu, 14 Nov 2019 18:47:02 +0200 Subject: [PATCH] set default userData from current logged in user --- includes/Core/Authentication/Authentication.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/includes/Core/Authentication/Authentication.php b/includes/Core/Authentication/Authentication.php index 4af01cb2615..876a6706551 100644 --- a/includes/Core/Authentication/Authentication.php +++ b/includes/Core/Authentication/Authentication.php @@ -466,7 +466,11 @@ private function refresh_auth_token_on_login() { */ private function inline_js_admin_data( $data ) { if ( ! isset( $data['userData'] ) ) { - $data['userData'] = array(); + $current_user = wp_get_current_user(); + $data['userData'] = array( + 'email' => $current_user->user_email, + 'picture' => get_avatar_url( $current_user->user_email ), + ); } $profile_data = $this->profile->get(); if ( $profile_data ) {