From 8a9e430c8fcbdd0b3218314e54f6ebc8a8d840ca Mon Sep 17 00:00:00 2001 From: Champ Camba Date: Fri, 21 Apr 2017 16:30:40 +0800 Subject: [PATCH] Remove notices --- core/um-api.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/core/um-api.php b/core/um-api.php index b2bdd4ef..4de82a46 100644 --- a/core/um-api.php +++ b/core/um-api.php @@ -736,6 +736,9 @@ class UM_REST_API { * Modify User Profile */ function user_key_field( $user ) { + + if( ! isset( $user->ID ) ) return; + if ( current_user_can( 'edit_users' ) && current_user_can( 'edit_user', $user->ID ) ) { $user = get_userdata( $user->ID ); ?>